Open
Description
SUMMARY
On FreeBSD hosts gathering network facts does'n work for tunnel interface (tun(4)) is present. If IFCONFIG_FORMAT=inet:cid
environment variable is set module fails with error error('illegal IP address string passed to inet_aton',)
otherwise incorrect netmask returned for tun interface.
ISSUE TYPE
- Bug Report
COMPONENT NAME
setup module
ANSIBLE VERSION
config file = /usr/home/citrin/w/ansible-test/ansible.cfg
configured module search path = ['/home/citrin/.ansible/plugins/modules', '/usr/local/share/py36-ansible/plugins/modules']
ansible python module location = /usr/local/lib/python3.6/site-packages/ansible
executable location = /usr/local/bin/ansible
python version = 3.6.6 (default, Aug 7 2018, 12:18:31) [GCC 4.2.1 Compatible FreeBSD Clang 4.0.0 (tags/RELEASE_400/final 297347)]
CONFIGURATION
No relevant config changes.
OS / ENVIRONMEN
FreeBSD 11 amd64 on both: control and managed hosts.
STEPS TO REPRODUCE
- Create tunnel interface. In my case it was created by OpenVPN, but it can be created manually
ifconfig tun9 create
ifconfig tun9 inet 192.0.2.1 192.0.2.2 netmask 255.255.255.0
ifconfig tun9 up
- Set
IFCONFIG_FORMAT=inet:cidr,inet6:cidr
environment variable (exacts steps depends on used shell).
ifconfig output looks like:
> ifconfig tun9 [0]
tun9: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> metric 0 mtu 1500
options=80000<LINKSTATE>
inet 192.0.2.1 --> 192.0.2.2/24
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
groups: tun
- Run
ansible localhost -m setup
EXPECTED RESULTS
Network settings in resulting JSON
ACTUAL RESULTS
Facts JSON without network settings.
> ANSIBLE_KEEP_REMOTE_FILES=1 ansible localhost -m setup -vvv
...skipped...
<127.0.0.1> EXEC /bin/sh -c '/usr/local/bin/python3.6 /tmp/citrin/ansible-tmp-1535579150.976911-61719197742330/setup.py && sleep 0'
...skipped...
> /usr/local/bin/python3.6 /tmp/citrin/ansible-tmp-1535579150.976911-61719197742330/setup.py
...skipped...
OSError('illegal IP address string passed to inet_aton',)
Metadata
Metadata
Assignees
Labels
Priority 3 - Approved, No Time LimitationThis issue/PR affects Ansible v2.6BSD communityThis issue/PR relates to a bug.This issue is considered easy to fix by aspiring contributors.This issue/PR relates to a module.This issue/PR relates to code supported by the Ansible Engineering Team.System category