Apply the igb1 address
authorKristof Provost <kp@FreeBSD.org>
Tue, 30 Apr 2024 08:28:59 +0000 (10:28 +0200)
committerKristof Provost <kp@FreeBSD.org>
Tue, 30 Apr 2024 08:28:59 +0000 (10:28 +0200)
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 [new file with mode: 0644]
ansible/roles/router/tasks/main.yaml

diff --git a/ansible/roles/router/handlers/main.yaml b/ansible/roles/router/handlers/main.yaml
new file mode 100644 (file)
index 0000000..08ecf9a
--- /dev/null
@@ -0,0 +1,4 @@
+---
+- name: "restart igb1"
+  command: /etc/rc.d/netif restart igb1
+  become: true
index 02c6366..dc0d68a 100644 (file)
@@ -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