Hey guys,
I’m using the Rackspace public cloud for hosting our app and as such I want to be able to create the Ansible hosts inventory file dynamically.
I’ve come across:
The issue I’ve got is that I need to be able to include host_vars in the JSON output of the script which creates the inventory dynamically. I need to do this so that I can specify ansible_ssh_host
for the boxes. I can’t just use the IP because I also have associated files in host_vars for the hosts.
e.g.
-
I have two clients: client01 and client02 (these are the cloud server names)
-
Each client has its own file in host_vars/
-
client02 cloud server is destroyed and recreated, therefore IPv4 change
-
Hosts inventory needs to have the alias client02 but a value for ansible_ssh_host for its new IP
Thanks
Everyone Advertises
Digital Animal Limited is registered in England and Wales under company number: 07757607. Registered office 47 Castle Street Reading RG1 7SR. VAT No: GB 121 1672 57
This electronic message contains information from Digital Animal Ltd which may be privileged or confidential. The information is intended to be for the use of the individuals or entity named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information is prohibited. If you have received this electronic message in error, please notify us by telephone or email (to the numbers or address above) immediately.