HI All,
Not sure how to put this in writing … hopefully I can make my point clear.
We use ansible for many different hosts to setup basic stuff like ntp/ssh access keys etc …
What I would like to do ( and what works for 1 host ) :
Create json variable files per host with contents for local facts and motd filling of that specific host
Commandline : ansible-playbook -i ‘my-targeted-host,’ all.yml --extra-vars “@hosts/my-targeted-host.json”
This fills up several variables define throughout the playbook with multiple roles
Question 1 : When I omit the json file , I want no changes to be made to the taget system in the variables.
Question 2: I would like to run the playbook against multiple hosts and have the playbook lookup the specific variables per host from these json files (hostname matches .json name)
So in this way I can use these .json files as a “inventory system” and these files can contain info per server like application owner which is placed in /etc/motd, when an owners leaves the company I want to do a subsitute of the name and rerun the playbook and refill the /etc/motd with the new aplication owners name ont the machines with that owner
Hopefully this is clear …
Pleas let me know what is possible ?