Last active
August 29, 2015 14:24
-
-
Save halberom/72b70a8cba934b9d58b9 to your computer and use it in GitHub Desktop.
Revisions
-
Gerard Lynch revised this gist
Jul 1, 2015 . 2 changed files with 8 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,9 @@ {% for host in groups['gluster_servers'] %} {% if host != inventory_hostname %} {% if 'ansible_' + rhel7_interface in hostvars[host] %} - {{ hostvars[host]['ansible_' + rhel7_interface]['ipv4']['address'] }} {% else %} - {{ hostvars[host]['ansible_' + default_interface]['ipv4']['address'] }} {% endif %} {% endif %} {% endfor %} This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,11 @@ --- - hosts: gluster_servers vars: rhel7_interface: enp0s3 default_interface: eth0 tasks: - set_fact: other_servers: "{{ lookup('template', 'lookup.j2') | from_yaml }}" - debug: msg: "addresses to use: {{ other_servers | join(',') }}" -
Gerard Lynch revised this gist
Jul 1, 2015 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ {% for host in groups['gluster_servers'] %} {% if host != inventory_hostname %} - {{ hostvars[host]['ansible_' + gluster_interface]['ipv4']['address'] }} -
Gerard Lynch revised this gist
Jul 1, 2015 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,6 @@ cluster_ips: {% for host in groups['gluster_servers'] %} {% if host != inventory_hostname %} - {{ hostvars[host]['ansible_' + gluster_interface]['ipv4']['address'] }} {% endif %} {% endfor %} -
Gerard Lynch revised this gist
Jul 1, 2015 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -3,5 +3,8 @@ vars: gluster_interface: eth0 tasks: - set_fact: other_servers: "{{ lookup('template', 'lookup.j2') | from_yaml }}" - debug: msg: "addresses to use: {{ other_servers | join(',') }} -
Gerard Lynch revised this gist
Jul 1, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ {% for host in groups['gluster_servers'] %} {% if host != inventory_hostname %} - {{ hostvars[host]['ansible_' + gluster_interface]['ipv4']['address'] }} {% endif %} {% endfor %} -
Gerard Lynch revised this gist
Jul 1, 2015 . 2 changed files with 7 additions and 9 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,5 @@ {% for host in groups['gluster_servers'] %} {% if host != inventory_hostname %} - {{ hostvars[host][gluster_interface]['ipv4']['address'] }} {% endif %} {% endfor %} This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,7 @@ --- - hosts: gluster_servers vars: gluster_interface: eth0 tasks: - debug: msg: "addresses to use: {{ lookup('template', 'lookup.j2') | from_yaml }} -
Gerard Lynch created this gist
Jul 1, 2015 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ {% for host in groups['gluster_servers'] %} - name: {{ host }} address: {{ hostvars[host][gluster_interface]['ipv4']['address'] }} {% endfor %} This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ --- - hosts: gluster_servers tasks: - set_fact: cluster_ips: "{{ lookup('template', 'lookup.j2') | from_yaml }} - debug: var: cluster_ips