xoxys.network/tasks/nm.yml
Robert Kaussow 893dff1d8c
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/notify Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci: migrate to woodpecker
2024-02-18 13:02:37 +01:00

30 lines
921 B
YAML

---
- name: Add NetworkManager configuration
ansible.builtin.copy:
content: "{{ item.value }}"
dest: "/etc/NetworkManager/conf.d/{{ item.key }}.conf"
owner: root
group: root
mode: "0640"
loop: "{{ network_nm_config | dict2items }}"
loop_control:
label: "{{ item.key }}"
notify: __network_host_reboot
- name: Register active NetworkManager configuration
ansible.builtin.find:
paths: /etc/NetworkManager/conf.d/
file_type: file
patterns: "*.conf"
register: __network_nm_config_active
changed_when: False
failed_when: False
- name: Remove unmanaged NetworkManager configuration
ansible.builtin.file:
path: "{{ item }}"
state: absent
loop: "{{ __network_nm_config_active.files | map(attribute='path') | list }}"
notify: __network_host_reboot
when: (item | basename | splitext | first) not in (network_nm_config | dict2items | map(attribute='key') | list)