8000 setup module: gathering facts fails on FreeBSD if tunnel is present · Issue #44869 · ansible/ansible · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
setup module: gathering facts fails on FreeBSD if tunnel is present #44869
Open
@citrin

Description

@citrin
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
  1. 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
  1. 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
  1. 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

No one assigned

    Labels

    P3Priority 3 - Approved, No Time Limitationaffects_2.6This issue/PR affects Ansible v2.6bsdBSD communitybugThis issue/PR relates to a bug.easyfixThis issue is considered easy to fix by aspiring contributors.moduleThis issue/PR relates to a module.python3support:coreThis issue/PR relates to code supported by the Ansible Engineering Team.systemSystem category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0