mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #15033 from ahammond/support_rhel_ipip
support IPIP interface type for RedHat linux.
This commit is contained in:
commit
0e868164f0
@ -68,6 +68,7 @@ _CONFIG_FALSE = ['no', 'off', 'false', '0', False]
|
||||
_IFACE_TYPES = [
|
||||
'eth', 'bond', 'alias', 'clone',
|
||||
'ipsec', 'dialup', 'bridge', 'slave', 'vlan',
|
||||
'ipip',
|
||||
]
|
||||
|
||||
|
||||
@ -575,7 +576,7 @@ def _parse_settings_eth(opts, iface_type, enabled, iface):
|
||||
if bonding:
|
||||
result['bonding'] = bonding
|
||||
|
||||
if iface_type not in ['bond', 'vlan', 'bridge']:
|
||||
if iface_type not in ['bond', 'vlan', 'bridge', 'ipip']:
|
||||
if 'addr' in opts:
|
||||
if salt.utils.validate.net.mac(opts['addr']):
|
||||
result['addr'] = opts['addr']
|
||||
@ -612,6 +613,14 @@ def _parse_settings_eth(opts, iface_type, enabled, iface):
|
||||
if 'bridge' in opts:
|
||||
result['bridge'] = opts['bridge']
|
||||
|
||||
if iface_type == 'ipip':
|
||||
result['devtype'] = 'IPIP'
|
||||
for opt in ['my_inner_ipaddr', 'my_outer_ipaddr']:
|
||||
if opt not in opts:
|
||||
_raise_error_iface(iface, opts[opt], ['1.2.3.4'])
|
||||
else:
|
||||
result[opt] = opts[opt]
|
||||
|
||||
for opt in ['ipaddr', 'master', 'netmask', 'srcaddr', 'delay', 'domain', 'gateway']:
|
||||
if opt in opts:
|
||||
result[opt] = opts[opt]
|
||||
@ -879,7 +888,7 @@ def build_interface(iface, iface_type, enabled, **settings):
|
||||
if iface_type == 'bridge':
|
||||
__salt__['pkg.install']('bridge-utils')
|
||||
|
||||
if iface_type in ['eth', 'bond', 'bridge', 'slave', 'vlan']:
|
||||
if iface_type in ['eth', 'bond', 'bridge', 'slave', 'vlan', 'ipip']:
|
||||
opts = _parse_settings_eth(settings, iface_type, enabled, iface)
|
||||
try:
|
||||
template = JINJA.get_template('rh{0}_eth.jinja'.format(rh_major))
|
||||
|
@ -19,6 +19,8 @@ DEVICE={{name}}
|
||||
{%endif%}{% if peerdns %}PEERDNS={{peerdns}}
|
||||
{%endif%}{% if bridge %}BRIDGE={{bridge}}
|
||||
{%endif%}{% if delay %}DELAY={{delay}}
|
||||
{%endif%}{% if my_inner_ipaddr %}MY_INNER_IPADDR={{my_inner_ipaddr}}
|
||||
{%endif%}{% if my_outer_ipaddr %}MY_OUTER_IPADDR={{my_outer_ipaddr}}
|
||||
{%endif%}{%if bonding %}BONDING_OPTS="{%for item in bonding %}{{item}}={{bonding[item]}} {%endfor%}"
|
||||
{%endif%}{% if ethtool %}ETHTOOL_OPTS="{%for item in ethtool %}{{item}} {{ethtool[item]}} {%endfor%}"
|
||||
{%endif%}{% if domain %}DOMAIN="{{ domain|join(' ') }}"
|
||||
|
@ -20,6 +20,8 @@ DEVICE="{{name}}"
|
||||
{%endif%}{% if defroute %}DEFROUTE="{{defroute}}"
|
||||
{%endif%}{% if bridge %}BRIDGE="{{bridge}}"
|
||||
{%endif%}{% if delay %}DELAY="{{delay}}"
|
||||
{%endif%}{% if my_inner_ipaddr %}MY_INNER_IPADDR={{my_inner_ipaddr}}
|
||||
{%endif%}{% if my_outer_ipaddr %}MY_OUTER_IPADDR={{my_outer_ipaddr}}
|
||||
{%endif%}{%if bonding %}BONDING_OPTS="{%for item in bonding %}{{item}}={{bonding[item]}} {%endfor%}"
|
||||
{%endif%}{% if ethtool %}ETHTOOL_OPTS="{%for item in ethtool %}{{item}} {{ethtool[item]}} {%endfor%}"
|
||||
{%endif%}{% if domain %}DOMAIN="{{ domain|join(' ') }}"
|
||||
|
Loading…
Reference in New Issue
Block a user