Hi,
I am running Ansible from a python script and I want to iterate over a dynamic list created in the python script. The inventory is also dynamically created in this script. The list is different for each host Ansible is connecting to. I don’t want to put the list into the host_vars where I want to keep only static variables. So I tried to put these variables in my dynamically created yaml inventory for each host. This does not seem to work, ansible says the list is not defined. However if I put the list in the group, it is working:
this is not working
`
ma:
hosts:
maman1-lab:
vars:
devicesids:
- d46798753
maman2-lab:
vars:
devicesids: - d46798752
`
But this is working (but not what I want)
`
ma:
hosts:
maman1-lab:
maman2-lab:
vars:
devicesids:
- d46798752
- d46798753
`
Is it possible to associate a list of vars to a single host and not to an entire group?
thanks
Bundy