Build / build (pull_request) Successful in 34s
Lint / renovate-config (pull_request) Successful in 9s
Molecule / select (pull_request) Successful in 9s
Lint / lint (pull_request) Successful in 2m45s
Molecule / scenarios (pull_request) Successful in 3m24s
Molecule / Result (pull_request) Successful in 2s
The refusal message and the changelog fragment now tell the consumer to remove app_password from pihole_overrides, the fragment says the first run after upgrading re-renders pihole.toml and reconfigures Pi-hole, and the role description lists the empty app_password among the conditions it checks. Refs: #383 Assisted-by: Claude Code
93 lines
4.7 KiB
YAML
93 lines
4.7 KiB
YAML
---
|
|
argument_specs:
|
|
main:
|
|
short_description: Install and configure Pi-hole from the upstream repository
|
|
description:
|
|
- >-
|
|
Asserts an Ubuntu host and the merged settings, merges the C(pihole_overrides) dictionary over
|
|
C(pihole_default), installs the apt dependencies, creates the C(pihole) system user, renders C(pihole.toml),
|
|
clones the upstream repository, runs its installer in unattended mode on first install, and runs the
|
|
installer's reconfigure mode when C(pihole.toml) changes.
|
|
- >-
|
|
The configuration contract is a single dictionary, C(pihole_overrides), whose keys are merged recursively
|
|
over C(pihole_default) in C(defaults/main.yml). The spec types it as a dictionary only, because sub-options
|
|
would reject every key it does not list. The merged result is an internal fact and never overwrites the
|
|
input. The role fails unless the merged C(config.dns.upstreams) is a non-empty list, C(config.dns.interface)
|
|
is a non-empty string, C(config.webserver.api.password) is a string other than
|
|
C(changetoyourownpassword) and C(config.webserver.api.app_password) is empty.
|
|
- >-
|
|
C(pihole_default) (every setting rendered into C(pihole.toml)) and C(pihole_install_script) (the quoted
|
|
installer path under C(repo.path)) are role defaults deliberately not listed here, because argument
|
|
validation templates every listed variable. C(pihole_install_script) reads the merged settings, which the
|
|
role sets only after validation. Templating C(pihole_default) would turn a missing C(pihole_web_password)
|
|
into an undefined-variable error before the clean missing-required-arguments message. Override settings
|
|
through C(pihole_overrides) instead.
|
|
options:
|
|
pihole_web_password:
|
|
type: raw
|
|
required: true
|
|
no_log: true
|
|
description:
|
|
- >-
|
|
The Pi-hole web interface and API password, the default of the merged
|
|
C(config.webserver.api.password). A secret: source it from a vaulted variable. Required even when
|
|
C(pihole_overrides) sets the password, because the merge templates the whole of C(pihole_default),
|
|
which references it.
|
|
- The rendered C(pihole.toml) holds it hashed twice with SHA-256 (C(pwhash)).
|
|
pihole_overrides:
|
|
type: dict
|
|
default: {}
|
|
no_log: true
|
|
description:
|
|
- >-
|
|
Overrides merged recursively over C(pihole_default). Specify only the keys to change. Define the whole
|
|
dictionary in one place, because a dictionary set in two variable sources is not merged and the
|
|
higher-precedence one wins.
|
|
- >-
|
|
C(config.dns.interface) must be set (string, for example C(eth0)): its default is an empty placeholder
|
|
and the role fails until it is set. C(config.dns.upstreams) (list of IP addresses or hostnames,
|
|
optionally with C(#port)) must stay non-empty. C(config.webserver.api.password) must stay a string.
|
|
C(config.webserver.api.totp_secret) is also a credential.
|
|
- >-
|
|
C(config.webserver.api.app_password) must stay empty and C(app_pwhash) always renders empty, which
|
|
disables app passwords: released pihole-FTL replaces the main web password on a login with a
|
|
legacy-hashed app password.
|
|
- >-
|
|
Other keys the tasks read are C(repo.remote), C(repo.version) (a tag, default C(v6.4)), C(repo.path)
|
|
(default C(~/.cache/pi-hole) of the connecting user), C(user), C(group) (both default C(pihole)) and
|
|
C(config.files.database) (its directory receives C(pihole.toml)). Every other key is rendered into
|
|
C(pihole.toml).
|
|
pihole_testing:
|
|
type: bool
|
|
default: false
|
|
description:
|
|
- >-
|
|
When true the role prints the merged settings with the web password, app password and TOTP secret
|
|
masked, pauses C(pihole_testing_timeout) seconds, and on a first install reads and prints the installer
|
|
log.
|
|
pihole_testing_timeout:
|
|
type: int
|
|
default: 5
|
|
description:
|
|
- Seconds to pause after the merge result is printed. Only used when C(pihole_testing) is true.
|
|
pihole_apt_dependencies:
|
|
type: list
|
|
elements: str
|
|
default:
|
|
- curl
|
|
- git
|
|
- procps
|
|
- lighttpd-mod-deflate
|
|
- apt-utils
|
|
- whiptail
|
|
- dnsutils
|
|
- bc
|
|
- unzip
|
|
- wget
|
|
- sudo
|
|
- netcat-openbsd
|
|
- cron
|
|
- iproute2
|
|
description:
|
|
- apt packages installed before the clone. Overriding replaces the whole list.
|