Description of Issue/Question
Salt reports Interface xxx:x is up when no changes have been made to a correctly configured interface alias.
I would expect that if no changes have been made then no changes would be reported back.
Setup
# State File (testcase/interface_alias.sls)
alias-interface:
network.managed:
- name: lo:0
- type: eth
- onboot: True
- ipaddr: 10.22.66.8
- netmask: 255.255.255.255
- proto: static
Initial /etc/network/interfaces/ file:
# /etc/network/interfaces
auto lo
iface lo inet loopback
allow-hotplug enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
address 192.168.50.12
netmask 255.255.255.0
auto lo:0
iface lo:0 inet static
address 10.22.66.8
netmask 255.255.255.255
Steps to Reproduce Issue
Run using salt develop (ad0d83c)
# salt-call state.apply --output-diff testcase.interface_alias
local:
----------
ID: alias-interface
Function: network.managed
Name: lo:0
Result: True
Comment: Interface lo:0 is up to date.
Started: 12:59:12.715923
Duration: 1150.0 ms
Changes:
----------
status:
Interface lo:0 is up
Summary for local
------------
Succeeded: 1 (changed=1)
Failed: 0
------------
Total states run: 1
Total run time: 1.150 s
# /etc/network/interfaces
auto lo
iface lo inet loopback
allow-hotplug enp0s3
iface enp0s3 inet dhcp
auto enp0s8
iface enp0s8 inet static
address 192.168.50.12
netmask 255.255.255.0
auto lo:0
iface lo:0 inet static
address 10.22.66.8
netmask 255.255.255.255
The issue seems to be related to when salt parses the interfaces (salt.utils.network._interfaces_ip) it lumps the alias IP in with the lo interface and then lo:0 does not match against lo (salt.states.network.managed). Maybe lo:0 should be returned as a separate interface?
Versions Report
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.5.3
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.9.4
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.6.0
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.13 (default, Sep 26 2018, 18:42:22)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.4.3
ZMQ: 4.2.1
System Versions:
dist: debian 9.2
locale: UTF-8
machine: x86_64
release: 4.9.0-4-amd64
system: Linux
version: debian 9.2
Description of Issue/Question
Salt reports
Interface xxx:x is upwhen no changes have been made to a correctly configured interface alias.I would expect that if no changes have been made then no changes would be reported back.
Setup
Initial
/etc/network/interfaces/file:Steps to Reproduce Issue
Run using salt develop (ad0d83c)
The issue seems to be related to when salt parses the interfaces (
salt.utils.network._interfaces_ip) it lumps the alias IP in with thelointerface and thenlo:0does not match againstlo(salt.states.network.managed). Maybelo:0should be returned as a separate interface?Versions Report