From 622c354683fba70f51898be90d62e56a69da4bad Mon Sep 17 00:00:00 2001 From: Michael Lustfield Date: Tue, 28 Aug 2018 21:24:56 -0500 Subject: [PATCH] Support reading multiple addresses from interface files. --- salt/modules/debian_ip.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/salt/modules/debian_ip.py b/salt/modules/debian_ip.py index dfa982461e..39ceda5478 100644 --- a/salt/modules/debian_ip.py +++ b/salt/modules/debian_ip.py @@ -629,7 +629,12 @@ def _parse_interfaces(interface_files=None): attrname = attr (valid, value, errmsg) = _validate_interface_option( attr, valuestr, addrfam) - iface_dict[attrname] = value + if attrname == 'address' and 'address' in iface_dict: + if 'addresses' not in iface_dict: + iface_dict['addresses'] = [] + iface_dict['addresses'].append(value) + else: + iface_dict[attrname] = value elif attr in _REV_ETHTOOL_CONFIG_OPTS: if 'ethtool' not in iface_dict: @@ -1710,11 +1715,6 @@ def build_interface(iface, iface_type, enabled, **settings): if 'proto' not in settings: settings['proto'] = 'static' - if 'ipv6ipaddr' not in settings and 'ipv6ipaddrs' in settings: - settings['ipv6ipaddr'] = settings['ipv6ipaddrs'].pop(0) - if 'ipaddr' not in settings and 'ipaddrs' in settings: - settings['ipaddr'] = settings['ipaddrs'].pop(0) - if iface_type == 'slave': settings['slave'] = 'yes' if 'master' not in settings: