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 | 842335e8c3a3ed237e14be3223d1efe59da7b534 (patch) | |
| tree | 4ff60f0801ecb934c34fe9c72d9b35ca4d15dd04 | |
| parent | d2dc60f222d1b3d47676149ac358266f889db200 (diff) | |
Fix pihole_dhcp_lease_time configurations
| -rw-r--r-- | host_vars/rpi5.local.yml | bin | 716 -> 717 bytes | |||
| -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 |
4 files changed, 5 insertions, 5 deletions
diff --git a/host_vars/rpi5.local.yml b/host_vars/rpi5.local.yml Binary files differindex e571289d..80e6dc4d 100644 --- a/host_vars/rpi5.local.yml +++ b/host_vars/rpi5.local.yml 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 %} |
