hi,
im running a master/slave cluster where i want to add another slave via ansible so i am limiting the play to the new slave
ansible-playbook -vvv -l mesos_slaves[3] -i hosts-prod.yml playbook.yml -u xxx -k -K
Add a point there comes a template which needs the ips of the other slaves
`
{% for host in groups[‘mesos_slaves’] %}
{{ hostvars[host][‘ansible_eth0’][‘ipv4’][‘address’] }}"
{% endfor %}
`
where mesos_slaves is
`
[mesos_slaves]
slave01
slave02
slave03
slave04
`
The play ends there with
`
fatal: [slave04] => {‘msg’: “AnsibleUndefinedVariable: One or more undefined variables: ‘dict object’ has no attribute ‘ansible_eth0’”, ‘failed’: True}
fatal: [slave04] => {‘msg’: “AnsibleUndefinedVariable: One or more undefined variables: ‘dict object’ has no attribute ‘ansible_eth0’”, ‘failed’: True}
`
but a
`
ansible -i hosts-prod.yml slave01 -m setup -a “filter=eth0”
`
gives me
`
slave01 | success >> {
“ansible_facts”: {
“ansible_eth0”: {
“active”: true,
“device”: “eth0”,
“ipv4”: {
“address”: “192.168.0.12”,
`
Why is it not working in the play?
Mike