Here is an example of inventory file:
[web_servers]
web_server-1 ansible_ssh_host=xxx ansible_ssh_user=yyy
[ops_servers]
ops_server-1 ansible_ssh_host=xxx ansible_ssh_user=zzz
Furthermore, web_servers
group has specific vars in group_vars/web_servers
:
tomcat_jmx_port: 123456
How can I access tomcat_jmx_port
var when dealing with ops_servers
?
Some will probably say I need a commun ancessor group (like all
) to put common vars, but this is just an example, in true life there are many vars I want to access from ops_servers
, and I want to keep things clear so tomcat_jmx_port
have to stay in web_servers
group_vars file.
In fact, I need a kind of local lookup.
Any idee ?
Thanks for your help.