ansible/roles/systemd_link/tasks/main.yml

23 lines
569 B
YAML
Raw Normal View History

2023-03-27 13:09:58 +02:00
---
- name: Configure links
template:
src: link.j2
dest: "/etc/systemd/network/10-{{ item.key }}.link"
owner: root
group: root
mode: u=rw,g=r,o=r
when: "item.value.enabled | default(True)"
loop: "{{ systemd_link__links | dict2items }}"
notify:
- Restart systemd-udev-trigger
- name: Remove disabled links
file:
path: "/etc/systemd/network/10-{{ item.key }}.link"
state: absent
when: "not (item.value.enabled | default(True))"
loop: "{{ systemd_link__links | dict2items }}"
notify:
- Restart systemd-udev-trigger
...