mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fixes #39901 for RH/CentOS 7
This commit is contained in:
parent
304dd2529d
commit
6818f3631d
2 changed files with 13 additions and 3 deletions
|
@ -689,9 +689,14 @@ def _parse_settings_eth(opts, iface_type, enabled, iface):
|
|||
if opt in opts:
|
||||
result[opt] = opts[opt]
|
||||
|
||||
for opt in ['ipaddrs', 'ipv6addrs']:
|
||||
if opt in opts:
|
||||
result[opt] = opts[opt]
|
||||
if 'ipaddrs' in opts:
|
||||
result['ipaddrs'] = []
|
||||
for opt in opts['ipaddrs']:
|
||||
ip, prefix = [i.strip() for i in opt.split('/')]
|
||||
result['ipaddrs'].append({'ipaddr': ip, 'prefix': prefix})
|
||||
|
||||
if 'ipv6addrs' in opts:
|
||||
result['ipv6addrs'] = opts['ipv6addrs']
|
||||
|
||||
if 'enable_ipv6' in opts:
|
||||
result['enable_ipv6'] = opts['enable_ipv6']
|
||||
|
|
|
@ -19,12 +19,17 @@ DEVICE="{{name}}"
|
|||
{%endif%}{% if ipaddr_end %}IPADDR_END="{{ipaddr_end}}"
|
||||
{%endif%}{% if netmask %}NETMASK="{{netmask}}"
|
||||
{%endif%}{% if prefix %}PREFIX="{{prefix}}"
|
||||
{%endif%}{% if ipaddrs %}{% for i in ipaddrs -%}
|
||||
IPADDR{{loop.index}}="{{i['ipaddr']}}"
|
||||
PREFIX{{loop.index}}="{{i['prefix']}}"
|
||||
{% endfor -%}
|
||||
{%endif%}{% if gateway %}GATEWAY="{{gateway}}"
|
||||
{%endif%}{% if enable_ipv6 %}IPV6INIT="yes"
|
||||
{% if ipv6_autoconf %}IPV6_AUTOCONF="{{ipv6_autoconf}}"
|
||||
{%endif%}{% if dhcpv6c %}DHCPV6C="{{dhcpv6c}}"
|
||||
{%endif%}{% if ipv6addr %}IPV6ADDR="{{ipv6addr}}"
|
||||
{%endif%}{% if ipv6gateway %}IPV6_DEFAULTGW="{{ipv6gateway}}"
|
||||
{%endif%}{% if ipv6addrs %}IPV6ADDR_SECONDARIES="{{ ipv6addrs|join(' ') }}"
|
||||
{%endif%}{% if ipv6_peerdns %}IPV6_PEERDNS="{{ipv6_peerdns}}"
|
||||
{%endif%}{% if ipv6_defroute %}IPV6_DEFROUTE="{{ipv6_defroute}}"
|
||||
{%endif%}{% if ipv6_peerroutes %}IPV6_PEERROUTES="{{ipv6_peerroutes}}"
|
||||
|
|
Loading…
Add table
Reference in a new issue