Interface not found
ThomasGsp opened this issue · 0 comments
ThomasGsp commented
Hello,
Due to the "source" in /etc/interface/networks, the interfaces are not detected and cannot to be managed.
source /etc/network/interfaces.d/*
Manual test:
(dev-template)root:~ # ifdown ens18
ifdown: interface ens18 not configured
Role output:
TASK [network : restart devices] **********************************************************************************************************************************************************************************
failed: [debian-template] (item={'_ansible_item_label': {'netmask': '255.255.255.0', 'family': 'inet', 'device': 'ens18', 'auto': True, 'method': 'static', 'gateway': '172.16.0.254', 'address': '172.16.0.246'}, 'src': '/home/ansible/.ansible/tmp/ansible-tmp-1553771856.3032446-32345386673075/source', 'checksum': 'ed8bf580ed4b362a650409c554e71bdae1761f54', 'md5sum': '94f68a32033e481e6f76e00ec73ffbe8', 'changed': True, 'gid': 0, '_ansible_no_log': False, 'group': 'root', 'state': 'file', 'dest': '/etc/network/interfaces.d/device-ens18-inet', 'uid': 0, 'owner': 'root', 'size': 124, 'failed': False, 'invocation': {'module_args': {'directory_mode': None, 'force': True, 'delimiter': None, 'seuser': None, 'owner': None, 'content': None, 'attributes': None, 'regexp': None, 'mode': None, '_original_basename': 'device.j2', 'src': '/home/ansible/.ansible/tmp/ansible-tmp-1553771856.3032446-32345386673075/source', 'backup': False, 'checksum': 'ed8bf580ed4b362a650409c554e71bdae1761f54', 'serole': None, 'group': None, 'dest': '/etc/network/interfaces.d/device-ens18-inet', 'selevel': None, 'follow': False, 'validate': None, 'remote_src': None, 'unsafe_writes': None, 'local_follow': None, 'setype': None}}, 'diff': [], '_ansible_item_result': True, '_ansible_ignore_errors': None, '_ansible_parsed': True, 'item': {'netmask': '255.255.255.0', 'family': 'inet', 'device': 'ens18', 'auto': True, 'method': 'static', 'gateway': '172.16.0.254', 'address': '172.16.0.246'}, 'mode': '0644'}) => {"changed": true, "cmd": "[ -n \"$(ifquery --list --exclude=lo)\" ] && udevadm settle && ip addr flush ens18 && (ifdown ens18 --exclude=lo || true) && ifup ens18 --exclude=lo", "delta": "0:00:00.009125", "end": "2019-03-28 11:17:54.994712", "item": {"changed": true, "checksum": "ed8bf580ed4b362a650409c554e71bdae1761f54", "dest": "/etc/network/interfaces.d/device-ens18-inet", "diff": [], "failed": false, "gid": 0, "group": "root", "invocation": {"module_args": {"_original_basename": "device.j2", "attributes": null, "backup": false, "checksum": "ed8bf580ed4b362a650409c554e71bdae1761f54", "content": null, "delimiter": null, "dest": "/etc/network/interfaces.d/device-ens18-inet", "directory_mode": null, "follow": false, "force": true, "group": null, "local_follow": null, "mode": null, "owner": null, "regexp": null, "remote_src": null, "selevel": null, "serole": null, "setype": null, "seuser": null, "src": "/home/ansible/.ansible/tmp/ansible-tmp-1553771856.3032446-32345386673075/source", "unsafe_writes": null, "validate": null}}, "item": {"address": "172.16.0.246", "auto": true, "device": "ens18", "family": "inet", "gateway": "172.16.0.254", "method": "static", "netmask": "255.255.255.0"}, "md5sum": "94f68a32033e481e6f76e00ec73ffbe8", "mode": "0644", "owner": "root", "size": 124, "src": "/home/ansible/.ansible/tmp/ansible-tmp-1553771856.3032446-32345386673075/source", "state": "file", "uid": 0}, "msg": "non-zero return code", "rc": 1, "start": "2019-03-28 11:17:54.985587", "stderr": "ifdown: interface ens18 not configured\nRTNETLINK answers: File exists\nifup: failed to bring up ens18", "stderr_lines": ["ifdown: interface ens18 not configured", "RTNETLINK answers: File exists", "ifup: failed to bring up ens18"], "stdout": "", "stdout_lines": []}
Interface:
(dev-template)root:~ # ip a
.....
2: ens18: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 26:6b:91:86:cd:0d brd ff:ff:ff:ff:ff:ff
inet 172.16.0.246/24 brd 172.16.0.255 scope global ens18
valid_lft forever preferred_lft forever
Env:
ansible 2.6.3
Linux debian-template 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux
Debian 9.8
Thomas.