-
-
Save arbabnazar/ea752ba4d9d5ed2702fc2955eef5c0a2 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