r/hass-dhcp: Start dnsmasq after network is up

The *vlan99* interface needs to be created and activated by
`systemd-networkd` before `dnsmasq` can start and bind to it.  Ordering
the *dnsmasq.service* unit after *network.target* and
*network-online.target* should ensure that this is the case.
btop
Dustin 2022-08-21 08:03:00 -05:00
parent b8b8ae5798
commit 7044cf3a46
2 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,4 @@
[Unit]
After=network.target
After=network-online.target
Wants=network-online.target

View File

@ -13,6 +13,25 @@
notify: notify:
- restart dnsmasq - restart dnsmasq
- name: ensure dnsmasq systemd unit drop-in directory exists
file:
path: /etc/systemd/system/dnsmasq.service.d
mode: u=rwx,go=rx
owner: root
group: root
state: directory
tags:
- systemd
- name: ensure dnsmasq starts after network is up
copy:
src: after-network.conf
dest: /etc/systemd/system/dnsmasq.service.d/after-network.conf
mode: u=rw,go=r
owner: root
group: root
tags:
- systemd
- meta: flush_handlers - meta: flush_handlers
- name: ensure homeassistant firewall zone exists - name: ensure homeassistant firewall zone exists
firewalld: firewalld: