From c5e3c861abd244a6bab7afa5654f8cf1f6fcc0a1 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Wed, 28 Mar 2018 19:27:39 -0500 Subject: [PATCH] roles/dch-gw: Ensure dhcpcd starts after network `dhcpcd` needs to start after the `network` service has started, as the latter creates the interfaces to which the former needs to delegate IPv6 prefixes. --- roles/dch-gw/files/dhcpcd-after-network.conf | 2 ++ roles/dch-gw/handlers/main.yml | 2 ++ roles/dch-gw/tasks/main.yml | 12 ++++++++++++ 3 files changed, 16 insertions(+) create mode 100644 roles/dch-gw/files/dhcpcd-after-network.conf diff --git a/roles/dch-gw/files/dhcpcd-after-network.conf b/roles/dch-gw/files/dhcpcd-after-network.conf new file mode 100644 index 0000000..08e9d9f --- /dev/null +++ b/roles/dch-gw/files/dhcpcd-after-network.conf @@ -0,0 +1,2 @@ +[Unit] +After=network.service diff --git a/roles/dch-gw/handlers/main.yml b/roles/dch-gw/handlers/main.yml index 16be5ce..94054f5 100644 --- a/roles/dch-gw/handlers/main.yml +++ b/roles/dch-gw/handlers/main.yml @@ -1,2 +1,4 @@ +- name: reload systemd + command: systemctl daemon-reload - name: rebind dhcp leases command: dhcpcd -n diff --git a/roles/dch-gw/tasks/main.yml b/roles/dch-gw/tasks/main.yml index 84ab9cc..4a7cc22 100644 --- a/roles/dch-gw/tasks/main.yml +++ b/roles/dch-gw/tasks/main.yml @@ -6,6 +6,18 @@ notify: rebind dhcp leases - meta: flush_handlers +- name: ensure dhcpcd unit extension directory exists + file: + path=/etc/systemd/system/dhcpcd.service.d/ + mode=0755 + state=directory +- name: ensure dhcpcd starts after network + copy: + src=dhcpcd-after-network.conf + dest=/etc/systemd/system/dhcpcd.service.d/after-network.conf + mode=0644 + notify: reload systemd + - name: ensure ipv4 forwarding is enabled sysctl: name=net.ipv4.conf.all.forwarding