Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check if interface have ipv6 #23

Open
ByJacob opened this issue Dec 16, 2020 · 0 comments
Open

Add check if interface have ipv6 #23

ByJacob opened this issue Dec 16, 2020 · 0 comments

Comments

@ByJacob
Copy link

ByJacob commented Dec 16, 2020

In my case interface docker0 don't have configured ipv6:

"ansible_docker0": {
                "active": false,
                "device": "docker0",
                "id": "8000.0242d12d2f01",
                "interfaces": [],
                "ipv4": {
                    "address": "172.17.0.1",
                    "broadcast": "172.17.255.255",
                    "netmask": "255.255.0.0",
                    "network": "172.17.0.0"
                },
                "macaddress": "02:42:d1:2d:2f:01",
                "mtu": 1500,
                "promisc": false,
                "stp": false,
                "type": "bridge"
            },

And when run role i have error:

fatal: [xxxxxxx]: FAILED! => {"changed": false, "msg": "AnsibleUndefinedVariable: 'list object' has no attribute 'address'"}

I spent some time solving this problem, and it turned out that the code assumes that the interfaces are configured for ipv4 and ipv6

https://github.com/arillso/ansible.hosts/blob/main/templates/etc/hosts.j2#L46-L62

Workaround:

  • set hosts_ipv6: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant