Skip to content
Snippets Groups Projects
Commit 77617694 authored by Hinrikus Wolf's avatar Hinrikus Wolf
Browse files

networkd: add support for link files

parent 661062e1
No related branches found
No related tags found
1 merge request!5networkd: add support for link files
Pipeline #3837 passed
--- ---
# interfaces:
# - identifier: name_for_the_link_file
# match:
# PermanentMACAddress: "01:23:45:67:89:ab"
# link:
# Name: veryimportantinterface
#
# networkd: # networkd:
# - type: 'dhcp' # - type: 'dhcp'
# - type: 'static' # - type: 'static'
......
...@@ -21,6 +21,17 @@ ...@@ -21,6 +21,17 @@
notify: notify:
- restart networkd - restart networkd
- name: ensure there are link files if needed
template:
src: "interface.link.j2"
dest: "/etc/systemd/network/{{ item.0 }}-{{ item.1.identifier }}.link"
owner: root
group: root
mode: '0644'
with_indexed_items: "{{ interfaces|default([]) }}"
notify:
- restart networkd
- name: find network config files generated by the bootstrap process - name: find network config files generated by the bootstrap process
find: find:
path: /etc/systemd/network path: /etc/systemd/network
......
[Match]
{% for key, value in item.1["match"].items() %}
{{ key }}={{ value }}
{% endfor %}
[Link]
{% for key, value in item.1["link"].items() %}
{{ key }}={{ value }}
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment