Last active
March 21, 2021 01:01
-
-
Save Kickimanjaro/aa48f27e657a556bf81dfae95f52f847 to your computer and use it in GitHub Desktop.
This creates a list of all the IP addresses I want from a hostgroup. I want to exclude the local host from this list on each node. Is this possible in the template file or must I combine with another task to remove the unwanted value?
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
... | |
unicast_peer { | |
{% for host in groups['loadbalancers'] %} | |
{{ hostvars[host]['ansible_default_ipv4']['address'] }} | |
{% endfor %} | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment