Skip to content

Commit

Permalink
feat(dhcp): add pi-hole dhcp support (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtwnklr authored Mar 15, 2022
1 parent ef36e7a commit 5a3ad43
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@ Add `pi-hole` variable for config. These vars can be omited
* `pi_hole_rev_server_cidr` - (default: "") - `pi-hole` reverse cidr
* `pi_hole_blocking_enabled` - (default: true) - enable `pi-hole` blocking

## Define pi-hole dhcp configuration

* `pi_hole_dhcp_active` - (default: false) - enable `pi-hole` dhcp server
* `pi_hole_dhcp_start` - (default: "") - first ip address to hand out
* `pi_hole_dhcp_end` - (default: "") - last ip address to hand out
* `pi_hole_dhcp_router` - (default: "") - gateway ip address
* `pi_hole_dhcp_leasetime` - (default: "24") - dhcp lease time
* `pi_hole_domain` - (default: "lan") - `pi-hole` domain name
* `pi_hole_dhcp_ipv6` - (default: false) - enable IPv6 support
* `pi_hole_dhcp_rapid_commit` - (default: false) - enable dhcp v4 rapid commit

## Define pi-hole local DNS configuration
* `pi_hole_local_dns_records` - (default: "") - define `pi-hole` local DNS records. Expects a list of dictionnaries in which each items contains a key `ip` and `name`.

Expand Down
10 changes: 10 additions & 0 deletions templates/etc/pihole/setupVars.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ REV_SERVER_TARGET={{ pi_hole_rev_server_target }}
{% if pi_hole_rev_server_cidr is defined %}
REV_SERVER_CIDR={{ pi_hole_rev_server_cidr }}
{% endif %}
{% if pi_hole_dhcp_active %}
DHCP_ACTIVE=true
DHCP_START={{ pi_hole_dhcp_start }}
DHCP_END={{ pi_hole_dhcp_end }}
DHCP_ROUTER={{ pi_hole_dhcp_router }}
DHCP_LEASETIME={{ pi_hole_dhcp_leasetime | default(24) }}
PIHOLE_DOMAIN={{ pi_hole_domain | default('lan') }}
DHCP_IPv6={{ pi_hole_dhcp_ipv6 | default(false) | lower }}
DHCP_rapid_commit={{ pi_hole_dhcp_rapid_commit | default(false) | lower }}
{% endif %}

0 comments on commit 5a3ad43

Please sign in to comment.