blob: 85cc1e2fe8dfab6225dc0e81dceec734ff8f0691 (
plain) (
tree)
|
|
---
- name: Make sure /etc/systemd/network exists
file:
dest: '/etc/systemd/network'
state: directory
owner: root
group: root
mode: 0755
- name: Register existing network configuration
find:
paths: '/etc/systemd/network'
register: networkd_existing
- name: Configure network
copy:
dest: '/etc/systemd/network/'
src: '{{ item }}'
owner: root
group: root
mode: 0644
with_fileglob: 'networkd/*'
register: networkd_created
- name: Delete unneeded network configuration
file:
path: '/etc/systemd/network/{{ item }}'
state: absent
with_items: "{{ networkd_existing.files|map(attribute='path')|map('basename')|difference(networkd_created.results|map(attribute='item')|map('basename'))|list }}"
# vim: set ts=2 sw=2 et:
|