Created
September 22, 2015 23:05
-
-
Save retr0h/f25cf7f63dd4e812cd7c to your computer and use it in GitHub Desktop.
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
rabbit_hosts: "{{ hostvars|fetch_list_from_dict(groups.aio)|map(attribute='ansible_internal_primary_interface.ipv4.address')|map('add_port', rabbitmq.port)|join(',') }}" |
Sure beats the shit out of something like.
-{% macro rabbitmq_hosts() -%}
-{% for host in groups[rabbitmq_group] -%}
- {% if loop.last -%}
-'{{ rabbitmq_user }}@{{ hostvars[host]['ansible_hostname'] }}'
- {%- else -%}
-'{{ rabbitmq_user }}@{{ hostvars[host]['ansible_hostname'] }}',
- {%- endif -%}
-{% endfor -%}
-{% endmacro -%}
vs
+ {cluster_nodes, {[{{ hostvars|fetch_list_from_dict(groups[rabbitmq_group])|map(attribute='ansible_hostname')|map('add_at', rabbitmq_user)|map('to_quotes')|join(',') }}],disc} },
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
my god have mercy on your soul.