Last active
August 20, 2016 19:40
-
-
Save ernestas-poskus/8afc663df1848074c1f108c66dd6cd20 to your computer and use it in GitHub Desktop.
Ansible Tips
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 characters
# Extracting all ips from defined group | |
ips: "{{ groups['webservers']|map('extract', hostvars, ['ansible_eth1', 'ipv4', 'address'])|list }}" | |
# Iterate through dict, reject empty values | |
nsq_nsqd_opts: "{% for key, value in nsq_nsqd.iteritems() if value is not none %}-{{ key | replace('_', '-') }}=\"{{ value }}\" {% endfor %}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment