diff options
Diffstat (limited to 'ansible/roles/network/tasks/main.yml')
-rw-r--r-- | ansible/roles/network/tasks/main.yml | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ansible/roles/network/tasks/main.yml b/ansible/roles/network/tasks/main.yml new file mode 100644 index 0000000..5aaaeff --- /dev/null +++ b/ansible/roles/network/tasks/main.yml | |||
@@ -0,0 +1,40 @@ | |||
1 | --- | ||
2 | #- name: plop netplan | ||
3 | # copy: | ||
4 | # src: "{{ inventory_hostname }}.yaml" | ||
5 | # dest: "/etc/netplan/20-customNetworking.yaml" | ||
6 | # register: netplanCopy | ||
7 | # | ||
8 | #- name: generate netplan | ||
9 | # command: netplan generate | ||
10 | # register: netplanGenerated | ||
11 | # when: netplanCopy.changed | ||
12 | # | ||
13 | #- name: apply netplan | ||
14 | # command: netplan apply | ||
15 | # when: netplanGenerated.changed | ||
16 | |||
17 | - name: configure public network link through systemd directly | ||
18 | template: | ||
19 | src: network/custom.link | ||
20 | dest: "/etc/systemd/network/custom-{{ network.ethernets.interface }}.link" | ||
21 | register: networkUpdated | ||
22 | |||
23 | - name: configure public network address through systemd directly | ||
24 | template: | ||
25 | src: network/custom.network | ||
26 | dest: "/etc/systemd/network/custom-{{ network.ethernets.interface }}.network" | ||
27 | register: networkUpdated | ||
28 | |||
29 | - name: reload network since configuration changed | ||
30 | command: systemctl restart systemd-networkd | ||
31 | when: networkUpdated.changed | ||
32 | |||
33 | - name: re-query ansible facts since system changed | ||
34 | setup: | ||
35 | gather_subset: | ||
36 | - "!all" | ||
37 | - "!min" | ||
38 | - network | ||
39 | when: networkUpdated.changed | ||
40 | |||