Le 12/09/2015 20:33, William Muriithi a écrit :
> Afternoon,
>
> I have a template where I have a group of 4 IPs.  I want to make a
> list of the 3 IPs  - These 3 IPs are for the other database systems,
> so need to except the IP of the current database where the template is
> being deployed.  The line that does this is below, but over the can¹t
> seem to get it working despite looking at it for a couple of years
>
>
>
> /etc/ansible/roles/mysql/templates/template/galera.cnf.j2
>
>
> Š.
>
> wsrep_cluster_address=gcomm://{{databases | join(',') | difference
> (ansible_ipv4.bond0)}};
> Š..
>
>
>
> When I run the playbook, it fails with the following error.
>
> fatal: [192.168.149.241] => {'msg': "AnsibleUndefinedVariable: One or
> more undefined variables: 'ansible_ipv4' is undefined", 'failed':
> True}
> fatal: [192.168.149.241] => {'msg': 'One or more items failed.',
> 'failed': True, 'changed': False, 'results': [{'msg':
> "AnsibleUndefinedVariable: One or more undefined variables:
> 'ansible_ipv4' is undefined", 'failed':
> True}]} FATAL: all hosts have already failed ‹ aborting
>
>
>
> What would be the appropriate way  to use difference filter to achieve
> my goal here?
>
> Regards,
>
> William

Perhaps, you should have a look at run_once or/and delegated_to

Regards,

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/55F477F3.30408%40lenhof.eu.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to