Files
Kamino/roles/pihole/tasks/reconfigure.yml
T
Defame1297 66628635b9 feat(pihole): add the pihole role
Installs Pi-hole v6 on Ubuntu noble and resolute by cloning the
upstream repository and running its installer unattended, with
pihole.toml rendered from pihole_default merged with pihole_overrides.
A change to pihole.toml runs the installer's reconfigure mode.

Validation runs first under always: the host must be Ubuntu, and the
merged settings need a non-empty interface and upstream list and a
string password other than the placeholder. pihole_web_password is a
required no_log input. Computed values are internal __pihole_ names.

Derived from codeberg.org/ansible/pihole (GPL-3.0-only) with Pi-hole
FTL comment text (EUPL-1.2): REUSE.toml annotations, the EUPL-1.2
text and NOTICE entries record both. The README roadmap drops pihole.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-25 18:10:59 +00:00

18 lines
616 B
YAML

---
- name: Configure pihole.toml
become: true
ansible.builtin.template:
src: pihole.toml.j2
# rather than hard-code /etc/pihole ourselves we can ride on the coat-tails
# of any of the __pihole_effective.config.files vars
dest: "{{ __pihole_effective.config.files.database | dirname }}/pihole.toml"
owner: "{{ __pihole_effective.user }}"
group: "{{ __pihole_effective.group }}"
mode: '0664'
when: not ansible_check_mode or __pihole_config_dir.stat.exists
notify: reconfigure pihole
# the rendered file holds the password hashes and the TOTP secret
no_log: true
diff: false