I am getting the exact same issue as OP. I cloned the official
ansible-examples and am trying to deploy the hadoop example. I get part
the way through and then get the error:
TASK: [common | Create the hosts file for all machines]
***********************
fatal: [hadoop1] => {'msg': "One or more undefined variables: 'dict object'
has no attribute u'ansible_eth0'", 'failed': True}
fatal: [hadoop1] => {'msg': "One or more undefined variables: 'dict object'
has no attribute u'ansible_eth0'", 'failed': True}
fatal: [hadoop2] => {'msg': "One or more undefined variables: 'dict object'
has no attribute u'ansible_eth0'", 'failed': True}
fatal: [hadoop2] => {'msg': "One or more undefined variables: 'dict object'
has no attribute u'ansible_eth0'", 'failed': True}
fatal: [hadoop3] => {'msg': "One or more undefined variables: 'dict object'
has no attribute u'ansible_eth0'", 'failed': True}
fatal: [hadoop3] => {'msg': "One or more undefined variables: 'dict object'
has no attribute u'ansible_eth0'", 'failed': True}
When I do ansible -m setup all, I can see that ansible_eth0 exists and has
a dict of data, including the address from hosts.j2. Any clue what is
happening there?
For reference, here is my modified hosts file (as maybe there's something
wrong here?)
hadoop_master_primary ansible_ssh_host=centos6-hadoop01
hadoop_master_secondary ansible_ssh_host=centos6-hadoop02
hadoop1 ansible_ssh_host=centos6-hadoop03
hadoop2 ansible_ssh_host=centos6-hadoop04
hadoop3 ansible_ssh_host=centos6-hadoop05
[hadoop_all:children]
hadoop_masters
hadoop_slaves
qjournal_servers
zookeeper_servers
[hadoop_all:vars]
ansible_ssh_user=root
[hadoop_master_primary]
hadoop1
[hadoop_master_secondary]
hadoop2
[hadoop_masters:children]
hadoop_master_primary
hadoop_master_secondary
[hadoop_slaves]
hadoop1
hadoop2
hadoop3
[qjournal_servers]
hadoop1
hadoop2
hadoop3
[zookeeper_servers]
hadoop1 zoo_id=1
hadoop2 zoo_id=2
hadoop3 zoo_id=3
On Tuesday, November 12, 2013 1:26:04 AM UTC-8, Jean Philippe Caruana wrote:
>
> Hi,
>
> Le 10/11/2013 22:32, Michael DeHaan a �crit :
> > Have you narrowed this down by using --limit to exactly one host and
> > made sure there is an ipv4 address for that host?
> >
> > I'm guessing one host might not have an ipv4 address for that interface.
>
> I tested on a single server, I have the fact ansible_eth1 with
> ipv4.address and then I had the error when executing the playbook (see
> my first email).
> I used "ansible myserver.com -m setup -i inventory". Is it the same
> effect as --limit ?
>
> As seen in my debug test (printing {{ hostvars[host]['ansible_eth1'] }}
> on every host) gave me the following dict for every server (I masually
> checked, since I just have 8 servers for now) :
>
> {
> 'macaddress': 'x:x:x:x:x:x',
> 'module': 'tg3',
> 'mt': 9000,
> 'device': 'eth1',
> 'ipv4': {
> 'netmask': 'x.x.x.x',
> 'network': 'x.x.x.x',
> 'address': 'x.x.x.x' # <- here :)
> },
> 'ipv6': [
> {
> 'scope': 'link',
> 'prefix': '64',
> 'address': 'x::x:x:x:x'
> }
> ],
> 'active': True,
> 'type': 'ether'
> }
>
> When I ask for facts for one server, there is an ipv4 address on eth1.
> I checked, and all my servers do have an ipv4 address on eth1, either
> with ifconfig or with ansible facts.
>
> --
> Jean-Philippe Caruana
>
--
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].
For more options, visit https://groups.google.com/groups/opt_out.