From 82635c31356a7fe6aa107360591d77129fa8c4f0 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Tue, 30 Apr 2024 10:28:59 +0200 Subject: [PATCH] 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. --- ansible/roles/router/handlers/main.yaml | 4 ++++ ansible/roles/router/tasks/main.yaml | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 ansible/roles/router/handlers/main.yaml 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 -- 2.51.0