From 1204730924436ef9e1c7c49c9557837f9a5ed0e8 Mon Sep 17 00:00:00 2001 From: clarkzjw Date: Wed, 8 Feb 2023 00:40:09 -0800 Subject: fork https://github.com/mattsta/mailweb --- ansible/roles/network/tasks/main.yml | 40 ++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ansible/roles/network/tasks/main.yml (limited to 'ansible/roles/network/tasks') 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 @@ +--- +#- name: plop netplan +# copy: +# src: "{{ inventory_hostname }}.yaml" +# dest: "/etc/netplan/20-customNetworking.yaml" +# register: netplanCopy +# +#- name: generate netplan +# command: netplan generate +# register: netplanGenerated +# when: netplanCopy.changed +# +#- name: apply netplan +# command: netplan apply +# when: netplanGenerated.changed + +- name: configure public network link through systemd directly + template: + src: network/custom.link + dest: "/etc/systemd/network/custom-{{ network.ethernets.interface }}.link" + register: networkUpdated + +- name: configure public network address through systemd directly + template: + src: network/custom.network + dest: "/etc/systemd/network/custom-{{ network.ethernets.interface }}.network" + register: networkUpdated + +- name: reload network since configuration changed + command: systemctl restart systemd-networkd + when: networkUpdated.changed + +- name: re-query ansible facts since system changed + setup: + gather_subset: + - "!all" + - "!min" + - network + when: networkUpdated.changed + -- cgit v1.2.3