roles/hass-dhcp: Deploy DHCP server for HA
The *hass-dhcp* role installs dnsmasq and configures it to serve DHCP requests on the Home Assistant network. Since this network is not routed, the regular DHCP relay/server setup will not work.jenkins-master
parent
51d6e13a13
commit
2265dd235b
|
@ -11,3 +11,12 @@
|
||||||
service:
|
service:
|
||||||
name: httpd
|
name: httpd
|
||||||
state: started
|
state: started
|
||||||
|
|
||||||
|
- hosts: home-assistant
|
||||||
|
roles:
|
||||||
|
- hass-dhcp
|
||||||
|
tasks:
|
||||||
|
- name: ensure dnsmasq is running
|
||||||
|
service:
|
||||||
|
name: dnsmasq
|
||||||
|
state: started
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
hass_dhcp_range:
|
||||||
|
start: 192.168.1.100
|
||||||
|
end: 192.168.1.250
|
||||||
|
hass_dhcp_lease_time: 1h
|
||||||
|
hass_dns_domain: homeassistant.io
|
|
@ -0,0 +1,4 @@
|
||||||
|
- name: restart dnsmasq
|
||||||
|
service:
|
||||||
|
name: dnsmasq
|
||||||
|
state: restarted
|
|
@ -0,0 +1,14 @@
|
||||||
|
- name: ensure dnsmasq is installed
|
||||||
|
package:
|
||||||
|
name: dnsmasq
|
||||||
|
state: present
|
||||||
|
tags:
|
||||||
|
- install
|
||||||
|
|
||||||
|
- name: ensure dnsmasq is configured for homeassistant
|
||||||
|
template:
|
||||||
|
src: homeassistant.dnsmasq.conf.j2
|
||||||
|
dest: /etc/dnsmasq.d/homeassistant.conf
|
||||||
|
mode: '0644'
|
||||||
|
notify:
|
||||||
|
- restart dnsmasq
|
|
@ -0,0 +1,3 @@
|
||||||
|
interface={{ hass_interface }}
|
||||||
|
dhcp-range={{ hass_dhcp_range.start }},{{ hass_dhcp_range.end }},{{ hass_dhcp_lease_time }}
|
||||||
|
domain={{ hass_dns_domain }}
|
Loading…
Reference in New Issue