Created
April 5, 2018 18:31
-
-
Save fabiocruzcoelho/bce636bf8432ae946e761a6eb6a3ed10 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[host_group] | |
host-1 ansible_ssh_host=192.168.0.21 node_name=foo | |
host-2 ansible_ssh_host=192.168.0.22 node_name=bar | |
[host_group:vars] | |
custom_var=asdasdasd | |
You can access host group vars using: | |
{{ hostvars['host_group'].custom_var }} | |
If you need a specific value from specific host, you can use: | |
{{ hostvars[groups['host_group'][0]].node_name }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment