Reorganize network spec to more accurately reflect settings
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
#
|
||||
[NetDev]
|
||||
Name={{ item.key }}
|
||||
type={{ item.value.type }}
|
||||
Kind={{ item.value.device }}
|
||||
|
||||
{% if item.value.type.lower() == 'bond' %}
|
||||
{% if item.value.device.lower() == 'bond' %}
|
||||
[Bond]
|
||||
Mode={{ item.value.bond_mode | default('balance-rr') }}
|
||||
PrimaryReselectPolicy=always
|
||||
MIIMonitorSec=1s
|
||||
{% endif %}
|
||||
{% if item.value.type.lower() == 'vlan' %}
|
||||
{% if item.value.device.lower() == 'vlan' %}
|
||||
[VLAN]
|
||||
Id={{ item.key.partition('.')[2] }}
|
||||
{% endif %}
|
||||
|
@@ -14,14 +14,16 @@ DNS={{ server }}
|
||||
{% if item.value.bond is defined %}
|
||||
Bond={{ item.value.bond }}
|
||||
{% endif %}
|
||||
{% if item.value.dhcp | default(false) %}
|
||||
{% if not item.value.dhcp | default(false) %}
|
||||
|
||||
{% if item.value.gateway is defined %}
|
||||
Gateway={{ item.value.gateway | ansible.netcommon.ipaddr('address') }}
|
||||
{% for address in item.value.addresses %}
|
||||
{% endif %}
|
||||
{% for address in item.value.addresses | default([]) %}
|
||||
Address={{ address | ansible.netcommon.ipaddr('host/prefix') }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% for interface in skylab_networking.interfaces.keys() %}
|
||||
{% for interface in skylab_networking.keys() %}
|
||||
{% if interface.startswith(item.key) and interface.partition('.')[2] | regex_search('^[0-9]{1,4}$') and interface != item.key %}
|
||||
VLAN={{ interface }}
|
||||
{% endif %}
|
||||
|
Reference in New Issue
Block a user