--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAJ2TK023bDGckFjC6gJTJDbRVggw6o2Gjd5rCBWGZneEUiD5XQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Gents,
Could you elaborate a bit on how to use this?
You see, i’m trying to do the same thing:
# Cluster connection URL
{# set mysql_hosts = groups["tag_type_mysql"] | intersect(groups["tag_environment_dev"]) #}
wsrep_cluster_address=gcomm://{% for host in mysql_hosts %}{{ hostvars[host]['ansible_eth0']['ipv4']['address'] }},{% endfor %}
But the variable “mysql_hosts” does not seem to get populated:
fatal: [10.220.226.243] => {'msg': "AnsibleUndefinedVariable: One or more undefined variables: 'mysql_hosts' is undefined", 'failed': True
When I look at the two groups:
type mysql group
{{ groups.tag_type_mysql | to_nice_yaml }}
env dev group
{{ groups.tag_environment_dev | to_nice_yaml }}
They result in:
type mysql group
- 10.220.226.243
- 10.220.227.5
- 10.220.225.203
env dev group
- 10.220.2.242
- 10.220.3.129
- 10.220.227.77
- 10.220.222.24
- 10.220.221.8
- 10.220.226.9
- 10.220.226.243
- 10.220.226.70
- 10.220.227.5
- 10.220.225.203
- 10.220.227.20
- 10.220.1.169
- 10.220.225.84
- 10.220.220.247
- 10.220.225.126
so I know they exist and are filled..
Thanks for looking!
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/13d3a708-dd40-417c-87fb-c466df921974%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.