aboutsummaryrefslogtreecommitdiffstats
path: root/roles/space_server/tasks/networkd.yml
blob: deada301fddb77c39f20cd12bb2120c85ec73ae8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
---
- 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: