Hello,
I tring to write a role that manage installation of application modules on servers.
All modules must be installed in one time: installtion command takes list of modules to install.
My inventory file list all servers that must receive a module (module are groups) =>
module1:
hosts:
host_1.xxx.com:
host_2.xxx.com:
module2:
hosts:
host_1.xxx.com:
module3:
host_2.xxx.com:
But by default playbook iterate on groups not hosts.
- i got host_1.xxx.com and host_2.xxx.com for installtion module1
- i got host_1.xxx.com:for installtion of module2
- i got host_2.xxx.com for installtion of module3
But i want:
- host_1.xxx.com for installation of module1 and module2
- host_2.xxx.com for installation of module1 and module3
note: organize by group is important because some conifguration’s informations are passed to host_1.xxx.com about host_2.xxx.com modules and vice versa.
How can iterate on hosts and run install command with list of groups listed in inventory.
In other words i must iterate by host not by groups.
How to do that ?
Many thanks in andvance for any help