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

networkd: add support for link files

parent 661062e1
Branches
No related tags found
No related merge requests found
Pipeline #3835 failed
This commit is part of merge request !5. Comments created here will be created in the context of that merge request.
---
# interfaces:
# - identifier: name_for_the_link_file
# match:
# PermanentMACAddress: "01:23:45:67:89:ab"
# link:
# Name: veryimportantinterface
#
# networkd:
# - type: 'dhcp'
# - type: 'static'
......
......@@ -21,6 +21,17 @@
notify:
- restart networkd
- name: ensure there are link files to set names for network interfaces
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
find:
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