diff options
author | clarkzjw <[email protected]> | 2023-02-08 00:40:09 -0800 |
---|---|---|
committer | clarkzjw <[email protected]> | 2023-02-08 00:40:09 -0800 |
commit | 1204730924436ef9e1c7c49c9557837f9a5ed0e8 (patch) | |
tree | 129d79dfd11245751cee6d4082ff5d2f6e941610 /ansible/roles/network/tasks | |
parent | 9635ac4dedf69de5bff65785bcc16bef80b52d75 (diff) | |
download | mail-1204730924436ef9e1c7c49c9557837f9a5ed0e8.tar.gz |
Diffstat (limited to 'ansible/roles/network/tasks')
-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 | |||