blob: deada301fddb77c39f20cd12bb2120c85ec73ae8 (
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: '{{ item }}'
state: absent
with_items: "{{ networkd_existing.files|map(attribute='path')|difference(networkd_created.results|map(attribute='dest'))|list }}"
# vim: set ts=2 sw=2 et:
|