I tried with

vars:
       hc_id: 
"{{hc.json.results|json_query('[?name==`{{host_collection}}`].id')}}"

And with

vars:
      hc_id: 
"{{hc.json.results|json_query('[?name==`\"{{host_collection}}\"`].id')}}"

But the variable is empty always.

TASK [LIST id HC] 
*******************************************************************************************************************************************
ok: [] => {
    "hc_id": []
}

The problem is that I have a variable {{host_collection}} into another 
variable definition and I have to scaped the {} symbols, no?



El martes, 23 de octubre de 2018, 10:03:35 (UTC+2), Adrian Sebastian Dutu 
escribió:
>
> Define it under a vars section.
>>
>
> https://docs.ansible.com/ansible/devel/user_guide/playbooks_variables.html#variables-defined-in-a-playbook
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/9b1073b4-6582-40f6-9147-1ebdefc70940%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to