diff options
| author | Ahmed Abdelhalim <[email protected]> | 2025-09-02 14:07:07 +0200 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2025-09-02 14:07:07 +0200 |
| commit | 7b58b9a50b2359b36d0ad7597b2e14b170a1ac57 (patch) | |
| tree | 4ff60f0801ecb934c34fe9c72d9b35ca4d15dd04 /roles | |
| parent | a61e33c2ce6f138536492e006de7faf76662916a (diff) | |
Fix pihole_dhcp_lease_time configurations
Diffstat (limited to 'roles')
| -rw-r--r-- | roles/pihole/defaults/main.yml | 2 | ||||
| -rw-r--r-- | roles/pihole/meta/argument_specs.yml | 6 | ||||
| -rw-r--r-- | roles/pihole/templates/pihole.toml.j2 | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/roles/pihole/defaults/main.yml b/roles/pihole/defaults/main.yml index 1abac8e9..d3f8b09c 100644 --- a/roles/pihole/defaults/main.yml +++ b/roles/pihole/defaults/main.yml @@ -14,7 +14,7 @@ pihole_dhcp_enabled: false pihole_dhcp_start: "{{ ansible_default_ipv4.network | regex_replace('\\.0$', '.100') }}" pihole_dhcp_end: "{{ ansible_default_ipv4.network | regex_replace('\\.0$', '.199') }}" pihole_dhcp_router: "{{ ansible_default_ipv4.address }}" -pihole_dhcp_lease_time: 24 +pihole_dhcp_lease_time: "" pihole_dhcp_domain: "local" pihole_dhcp_hosts: [] pihole_domain: "" diff --git a/roles/pihole/meta/argument_specs.yml b/roles/pihole/meta/argument_specs.yml index 825d82d7..a2f9976f 100644 --- a/roles/pihole/meta/argument_specs.yml +++ b/roles/pihole/meta/argument_specs.yml @@ -46,9 +46,9 @@ argument_specs: description: "The dhcp server router (gateway) address" default: "{{ ansible_default_ipv4.address }}" pihole_dhcp_lease_time: - type: "int" - description: "The dhcp lease time in hours" - default: 24 + type: "str" + description: "The dhcp lease time string ex. ('45m', '1h', '2d', '1w') empty defaults to dnsmasq default" + default: "" pihole_dhcp_domain: type: "str" description: "The dhcp local domain extension" diff --git a/roles/pihole/templates/pihole.toml.j2 b/roles/pihole/templates/pihole.toml.j2 index 8fc5571d..23c02b7c 100644 --- a/roles/pihole/templates/pihole.toml.j2 +++ b/roles/pihole/templates/pihole.toml.j2 @@ -51,7 +51,7 @@ active = {{ pihole_dhcp_enabled | lower }} start = "{{ pihole_dhcp_start }}" end = "{{ pihole_dhcp_end }}" router = "{{ pihole_dhcp_router }}" -leaseTime = {{ pihole_dhcp_lease_time }} +leaseTime = "{{ pihole_dhcp_lease_time }}" domain = "{{ pihole_dhcp_domain }}" hosts = {{ pihole_dhcp_hosts | to_nice_json }} {% endif %} |
