From: Kristof Provost Date: Tue, 30 Apr 2024 08:28:59 +0000 (+0200) Subject: Apply the igb1 address X-Git-Url: https://git.sigsegv.be/?a=commitdiff_plain;h=82635c31356a7fe6aa107360591d77129fa8c4f0;p=pennestraat-domotica Apply the igb1 address Use a notification handler to actually apply the address (and force it to run immediately). This fixes the first startup of dhcpd, because dhcpd wants the relevant IP on the relevant interface before it'll work. --- diff --git a/ansible/roles/router/handlers/main.yaml b/ansible/roles/router/handlers/main.yaml new file mode 100644 index 0000000..08ecf9a --- /dev/null +++ b/ansible/roles/router/handlers/main.yaml @@ -0,0 +1,4 @@ +--- +- name: "restart igb1" + command: /etc/rc.d/netif restart igb1 + become: true diff --git a/ansible/roles/router/tasks/main.yaml b/ansible/roles/router/tasks/main.yaml index 02c6366..dc0d68a 100644 --- a/ansible/roles/router/tasks/main.yaml +++ b/ansible/roles/router/tasks/main.yaml @@ -3,6 +3,8 @@ name: ifconfig_igb1 value: "{{ lan_ip }} up" become: true + notify: "restart igb1" +- meta: flush_handlers - name: gateway enable community.general.sysrc: name: gateway_enable