mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #30491 from jacksontj/2015.8
Add multi-IP support to network state
This commit is contained in:
commit
d8d19cf75d
@ -632,6 +632,10 @@ 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 'ipv6_autoconf' in opts:
|
||||
result['ipv6_autoconf'] = opts['ipv6_autoconf']
|
||||
|
||||
|
@ -18,14 +18,14 @@ all interfaces are ignored unless specified.
|
||||
.. code-block:: yaml
|
||||
|
||||
system:
|
||||
network.system:
|
||||
- enabled: True
|
||||
- hostname: server1.example.com
|
||||
- gateway: 192.168.0.1
|
||||
- gatewaydev: eth0
|
||||
- nozeroconf: True
|
||||
- nisdomain: example.com
|
||||
- require_reboot: True
|
||||
network.system:
|
||||
- enabled: True
|
||||
- hostname: server1.example.com
|
||||
- gateway: 192.168.0.1
|
||||
- gatewaydev: eth0
|
||||
- nozeroconf: True
|
||||
- nisdomain: example.com
|
||||
- require_reboot: True
|
||||
|
||||
eth0:
|
||||
network.managed:
|
||||
@ -195,15 +195,31 @@ all interfaces are ignored unless specified.
|
||||
- network: eth4
|
||||
|
||||
system:
|
||||
network.system:
|
||||
- enabled: True
|
||||
- hostname: server1.example.com
|
||||
- gateway: 192.168.0.1
|
||||
- gatewaydev: eth0
|
||||
- nozeroconf: True
|
||||
- nisdomain: example.com
|
||||
- require_reboot: True
|
||||
- apply_hostname: True
|
||||
network.system:
|
||||
- enabled: True
|
||||
- hostname: server1.example.com
|
||||
- gateway: 192.168.0.1
|
||||
- gatewaydev: eth0
|
||||
- nozeroconf: True
|
||||
- nisdomain: example.com
|
||||
- require_reboot: True
|
||||
- apply_hostname: True
|
||||
|
||||
lo:
|
||||
network.managed:
|
||||
- name: lo
|
||||
- type: eth
|
||||
- onboot: yes
|
||||
- userctl: no
|
||||
- ipv6_autoconf: no
|
||||
- enable_ipv6: true
|
||||
- ipaddrs:
|
||||
- 127.0.0.1/8
|
||||
- 10.1.0.4/32
|
||||
- 10.1.0.12/32
|
||||
- ipv6addrs:
|
||||
- fc00::1/128
|
||||
- fc00::100/128
|
||||
|
||||
.. note::
|
||||
Apply changes to hostname immediately.
|
||||
|
@ -12,7 +12,10 @@
|
||||
{%endif%}{% if ipaddr_start %}IPADDR_START="{{ipaddr_start}}"
|
||||
{%endif%}{% if ipaddr_end %}IPADDR_END="{{ipaddr_end}}"
|
||||
{%endif%}{% if clonenum_start %}CLONENUM_START="{{clonenum_start}}"
|
||||
{%endif%}{% if netmask %}NETMASK="{{netmask}}"
|
||||
{%endif%}{% if ipaddrs %}{% for entry in ipaddrs %}{% set ipparts = entry.rsplit('/') -%}
|
||||
IPADDR{{loop.index - 1}}="{{ipparts[0]}}"
|
||||
PREFIX{{loop.index - 1}}="{{ipparts[1]}}"
|
||||
{%endfor -%}{%endif%}{% if netmask %}NETMASK="{{netmask}}"
|
||||
{%endif%}{% if gateway %}GATEWAY="{{gateway}}"
|
||||
{%endif%}{% if arpcheck %}ARPCHECK="{{arpcheck}}"
|
||||
{%endif%}{% if mtu %}MTU="{{mtu}}"
|
||||
@ -20,6 +23,7 @@
|
||||
{% if ipv6_autoconf %}IPV6_AUTOCONF="{{ipv6_autoconf}}"
|
||||
{%endif%}{% if ipv6addr %}IPV6ADDR="{{ipv6addr}}"
|
||||
{%endif%}{% if ipv6gateway %}IPV6_DEFAULTGW="{{ipv6gateway}}"
|
||||
{%endif%}{% if ipv6addrs %}IPV6ADDR_SECONDARIES="{{ipv6addrs | join(' ')}}"
|
||||
{%endif%}{%endif%}{% if srcaddr %}SRCADDR="{{srcaddr}}"
|
||||
{%endif%}{% if peerdns %}PEERDNS="{{peerdns}}"
|
||||
{%endif%}{% if peerntp %}PEERNTP="{{peerntp}}"
|
||||
@ -34,4 +38,4 @@
|
||||
{%endif%}{% if domain %}DOMAIN="{{ domain|join(' ') }}"
|
||||
{% endif %}{% for server in dns -%}
|
||||
DNS{{loop.index}}="{{server}}"
|
||||
{% endfor -%}
|
||||
{% endfor -%}
|
||||
|
Loading…
Reference in New Issue
Block a user