Skip to content
Snippets Groups Projects
Commit 6a624b35 authored by Thomas Schneider's avatar Thomas Schneider
Browse files

networkd: Configure Network.LinkLocalAddressing

parent f6a2a9fe
No related branches found
No related tags found
1 merge request!8networkd: Configure Network.LinkLocalAddressing
Pipeline #4930 passed
...@@ -10,11 +10,13 @@ ...@@ -10,11 +10,13 @@
# networkd: # networkd:
# - type: 'dhcp' # - type: 'dhcp'
# link_local_addressing: "no"
# - type: 'static' # - type: 'static'
# address: '10.10.10.10/24' # address: '10.10.10.10/24'
# gateway: '10.10.10.1' # gateway: '10.10.10.1'
# - type: 'routed' # - type: 'routed'
# identifier: 'file-name' # identifier: 'file-name'
# link_local_addressing: "ipv4"
# interfaces: # interfaces:
# - 'eth0' # - 'eth0'
# addresses: # addresses:
...@@ -76,6 +78,7 @@ networkd_bond_vlans: ...@@ -76,6 +78,7 @@ networkd_bond_vlans:
name: storage name: storage
bridge: false bridge: false
address: 10.10.10.10/24 address: 10.10.10.10/24
link_local_addressing: "no"
- id: 42 - id: 42
name: public name: public
bridge: true bridge: true
......
...@@ -6,6 +6,9 @@ DHCP=ipv4 ...@@ -6,6 +6,9 @@ DHCP=ipv4
{% if networkd_ipfwd %} {% if networkd_ipfwd %}
IPForward=yes IPForward=yes
{% endif %} {% endif %}
{% if network.link_local_addressing is defined %}
LinkLocalAddressing={{ network.link_local_addressing }}
{% endif %}
{% for custom in network.custom|default([]) %} {% for custom in network.custom|default([]) %}
[{{ custom.category }}] [{{ custom.category }}]
......
...@@ -10,6 +10,9 @@ Name={{ network.interfaces|default([network.interface])|join(' ') }} ...@@ -10,6 +10,9 @@ Name={{ network.interfaces|default([network.interface])|join(' ') }}
Address={{ addr }} Address={{ addr }}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% if (network.link_local_addressing|default(none)) is not none %}
LinkLocalAddressing={{ network.link_local_addressing }}
{% endif %}
{% for server in network.nameservers|default(nameservers) %} {% for server in network.nameservers|default(nameservers) %}
DNS={{ server }} DNS={{ server }}
{% endfor %} {% endfor %}
......
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
'interface': item.1.interface|default(networkd_interface|default(ansible_default_ipv4.interface)), 'interface': item.1.interface|default(networkd_interface|default(ansible_default_ipv4.interface)),
'addresses': item.1.addresses|default([item.1.adress|default(networkd_address)]), 'addresses': item.1.addresses|default([item.1.adress|default(networkd_address)]),
'gateway': item.1.gateway|default(networkd_gateway), 'gateway': item.1.gateway|default(networkd_gateway),
'link_local_addressing': item.1.link_local_addressing|default(None)
} %} } %}
{% include "20-wired-routed.network.j2" %} {% include "20-wired-routed.network.j2" %}
...@@ -6,3 +6,4 @@ Name={{ bond.bond|default(networkd_bond) }} ...@@ -6,3 +6,4 @@ Name={{ bond.bond|default(networkd_bond) }}
VLAN=vl-{{ vlan.name }} VLAN=vl-{{ vlan.name }}
{% endfor %} {% endfor %}
BindCarrier={{ bond.interfaces|default(networkd_bond_devices)|join(' ') }} BindCarrier={{ bond.interfaces|default(networkd_bond_devices)|join(' ') }}
LinkLocalAddressing=no
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
'interface': 'vmbr-' + item.name, 'interface': 'vmbr-' + item.name,
'addresses': [item.address] if item.address is defined else [], 'addresses': [item.address] if item.address is defined else [],
'nameservers': [], 'nameservers': [],
'routes': [{'gateway': item.gateway}] if item.gateway is defined else [] 'routes': [{'gateway': item.gateway}] if item.gateway is defined else [],
'link_local_addressing': item.link_local_addressing|default(None)
} %} } %}
{% include "20-wired-routed.network.j2" %} {% include "20-wired-routed.network.j2" %}
...@@ -9,7 +9,8 @@ Bridge=vmbr-{{ item.name }} ...@@ -9,7 +9,8 @@ Bridge=vmbr-{{ item.name }}
'interface': 'vl-' + item.name, 'interface': 'vl-' + item.name,
'addresses': item.addresses|default([item.address] if item.address is defined else []), 'addresses': item.addresses|default([item.address] if item.address is defined else []),
'nameservers': item.nameservers|default([]), 'nameservers': item.nameservers|default([]),
'routes': item.routes|default([{'gateway': item.gateway}] if item.gateway is defined else []) 'routes': item.routes|default([{'gateway': item.gateway}] if item.gateway is defined else []),
'link_local_addressing': item.link_local_addressing|default(None)
} %} } %}
{% include "20-wired-routed.network.j2" %} {% include "20-wired-routed.network.j2" %}
{% endif %} {% endif %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment