Skip to content

Instantly share code, notes, and snippets.

@pporada-gl
Last active December 9, 2016 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pporada-gl/9b2ec26c8d6c1f94c6faea27baee5fb3 to your computer and use it in GitHub Desktop.
Save pporada-gl/9b2ec26c8d6c1f94c6faea27baee5fb3 to your computer and use it in GitHub Desktop.
### Assume this list of ips
192.168.33.10,192.168.33.11,192.168.33.12
"retry_join": [{% for h in groups['consul_servers'] %}"{{ hostvars[h].ansible_eth1.ipv4.address|difference(ansible_all_ipv4_addresses)|list }}"{% if not loop.last %},{% endif %}{% endfor ,
### This will output
"retry_join": ["[u'1', u'9', u'2', u'.', u'6', u'8', u'3', u'0']"],
### I am looking for the following instead of ^
#### Assuming I am on box 192.168.33.12
"retry_join": ["192.168.33.10","192.168.33.11"],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment