Hello,
I'm trying to compose a variable name with another variable, to keep the
variables for each host on a single file/definition.
It looks like the following:
vars.yml:
netconf:
iface:
eth1
ip:
host-1:
172.16.1.100
host-2:
172.16.1.101
mask:
host-1:
255.255.255.252
host-2:
255.255.255.252
Inventory:
[test]
host-1
host-2
playbook.yml:
- hosts: test
- tasks:
- debug: msg="{{ netconf.ip.{{ ansible_hostname }} }}"
I know it can be done loading a different vars file for each host, but I
would like to keep them together on a single file. Also this composition
schema can be applied to other situations.
Anyone knows if It's possible to achieve that behavior?
BR,
Antonio
--
You received this message because you are subscribed to the Google Groups "Ansible
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.