On 12.03.2019 02:54, fusillator wrote:
#not yet working in ansible release 2.3.2
# when: lookup('vars', item|basename, default=false)
#workaround see role variable confobjs in the playbook launcher
when: confobjs[item|basename] is defined
register: template_result
I'm not sure I understand what you are trying to achieve, but I think
you are looking for this
hostvars[inventory_hostname][item|basename] is defined
It's not recommended to use vars, but this also works
vars[inventory_hostname][item|basename] is defined
If you want to combine variable with a string the syntax is
hostvars[inventory_hostname][myvar ~ 'my_string'] is defined
--
Kai Stian Olstad
--
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/6ff789851b9ea95695772502f3ea2527%40olstad.com.
For more options, visit https://groups.google.com/d/optout.