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