Hello Freddie,

On 1/3/19 12:04 PM, Freddie Eisa wrote:

{"changed": false, "msg": "AnsibleUndefinedVariable: 'dict object' has no attribute 'eth0'"}


How do you know what to look for in ansible_facts? Run the setup module against your managed hosts and see what the facts look like.

I have this on a node of mine:

  "ansible_facts": {
...,

     "ansible_default_ipv4": {
            "address": "XXXX",
            "alias": "eth0",
            "broadcast": "XXXX",
            "gateway": "XXXX",
            "interface": "eth0",
            "macaddress": "XXXXX",
            "mtu": 1500,
            "netmask": "255.255.248.0",
            "network": "XXXXXXX",
            "type": "ether"
        },
}


I don't see any hostvars[host]['ansible_facts']['eth0']['ipv4']['address']

Try  $ ansible <hostgroup> -m  setup and examine the output to see how you should look for eth0's IP address.


Cheers,


Hugo





--

Hugo F. gonzalez

Senior Consultant

Red Hat LATAM <https://www.redhat.com>

<https://red.ht/sig>

--
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/4473f03c-a4f0-f89c-5d92-77b2cf85ba01%40redhat.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to