Author SHA1 Message Date
Defame1297 067e0e4b3e docs(pihole): say how to clear app_password and what the upgrade run does
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
2026-12-06 22:09:22 +00:00
Defame1297 cb78edff6f fix(pihole)!: refuse a non-empty app password and render app_pwhash empty
Released pihole-FTL checks an app_pwhash that does not start with `$` as a
legacy double-SHA256 hash and, on a match, upgrades it to a BALLOON hash
written into the main webserver.api.pwhash. One login with the app
password the role rendered therefore replaced the web password. FTL
master fixes this, no release has it yet, and the role does not pin FTL.

validate.yml now refuses a non-empty config.webserver.api.app_password,
and the template always renders app_pwhash = "", which FTL treats as app
passwords disabled. The key stays in the defaults; only a value is
refused. Molecule verifies the rendered empty hash and the new refusal.

BREAKING CHANGE: a non-empty config.webserver.api.app_password now fails
the role, and app_pwhash always renders empty.

Refs: #383
Assisted-by: Claude Code
2026-12-06 21:35:12 +00:00
Defame1297 7cb99de32d Merge pull request 'chore(deps): update git.rkdr.net/mortis/ci docker tag to v0.2.55' (#534) from renovate/own-ci-images into main
Renovate / renovate (push) Successful in 43s
Reviewed-on: #534
2026-12-06 20:50:42 +00:00
renovate-bot 6a35c7407e chore(deps): update git.rkdr.net/mortis/ci docker tag to v0.2.55
Gitea release key / check (pull_request) Successful in 16s
Build / build (pull_request) Successful in 26s
Lint / renovate-config (pull_request) Successful in 7s
Molecule / select (pull_request) Successful in 4s
Molecule / scenarios (pull_request) Skipped
Molecule / Result (pull_request) Successful in 1s
Lint / lint (pull_request) Successful in 1m55s
2026-12-06 20:42:15 +00:00
Defame1297 ddfb1c6d0a Merge pull request 'docs(roles): allow a no_log output fact from an opt-in entry point; list openbao on the Roadmap' (#533) from docs/openbao-role-decisions into main
Renovate / renovate (push) Successful in 33s
Reviewed-on: #533
2026-12-06 20:41:43 +00:00
Defame1297 b2d29df657 docs(security): accept unseal keys in vaulted inventory for openbao
Build / build (pull_request) Successful in 23s
Lint / renovate-config (pull_request) Successful in 5s
Molecule / select (pull_request) Successful in 4s
Molecule / scenarios (pull_request) Skipped
Molecule / Result (pull_request) Successful in 1s
Lint / lint (pull_request) Successful in 2m0s
Assisted-by: Claude Code
2026-12-06 20:38:48 +00:00
Defame1297 2f2d980ef7 Merge branch 'main' into docs/openbao-role-decisions
Build / build (pull_request) Successful in 34s
Molecule / select (pull_request) Successful in 4s
Molecule / scenarios (pull_request) Skipped
Lint / renovate-config (pull_request) Successful in 7s
Molecule / Result (pull_request) Successful in 1s
Lint / lint (pull_request) Successful in 2m42s
2026-12-06 20:30:37 +00:00
Defame1297 fbdee5f778 docs(roles): count a no_log output fact from an opt-in entry point as handed to the consumer's store
Build / build (pull_request) Successful in 45s
Lint / lint (pull_request) Successful in 3m12s
Molecule / select (pull_request) Canceled after 0s
Molecule / scenarios (pull_request) Canceled after 0s
Molecule / Result (pull_request) Canceled after 0s
Lint / renovate-config (pull_request) Canceled after 7s
Also list openbao on the Roadmap, ahead of the role that removes it.

Assisted-by: Claude Code
2026-12-06 20:16:59 +00:00
10 changed files with 58 additions and 9 deletions

No files matched your search

+1
View File
@@ -42,6 +42,7 @@ when its own prerequisites (tests, a safe cutover wherever the role already runs
Still to come:
- Wave 3: `rke2`, `proxmox_host`.
- Not yet in a wave: `openbao`.
Will not be extracted (they serve one lab or install that lab's own tool pins):
`k8s_manage`, `k8s_localhost`, `k8s_lint_tools`, `minecraft_server`, `dragonwilds_server`,
+10
View File
@@ -126,3 +126,13 @@ reduction. A later decision that accepts a risk adds an entry here.
- **Trigger:** the pull request that moves `molecule.yml` to a new `molecule-controller` image
fails Molecule because of a changed image input.
- **Planned reduction:** none for now.
### Unseal keys in vaulted inventory
- **Risk:** the planned `openbao` role can unseal a Shamir-sealed OpenBao from unseal keys the
consumer keeps in vaulted inventory (`openbao_unseal_keys`), so whoever holds the Ansible
vault password can unseal alone. This weakens the split knowledge Shamir's scheme gives.
- **Why accepted:** it keeps restarts and updates unattended, and the Collection already keeps
secrets in vaulted inventory. The keys are optional: without them the role leaves the node
sealed and warns.
- **Trigger and planned reduction:** auto-unseal, tracked in #529.
@@ -0,0 +1,9 @@
---
breaking_changes:
- >-
pihole - A non-empty ``config.webserver.api.app_password`` is now refused, and ``app_pwhash``
always renders empty, which disables app passwords. Released pihole-FTL upgrades a
legacy-hashed app password on login by writing the new hash into the main ``pwhash``, so one
login with the app password replaced the web password. Remove
``config.webserver.api.app_password`` from ``pihole_overrides``; the first run after upgrading
re-renders ``pihole.toml`` and reconfigures Pi-hole.
+5
View File
@@ -68,6 +68,11 @@ names a check that does not exist yet and its backlog issue.
- **Secrets.** Never in plaintext in the repository, a role's defaults, task output or a file on
the controller; `no_log: true` on every task that carries one; a secret is a required input
with no default; a role generates one only straight into a secret store the consumer names.
A secret returned as a `no_log`, non-cacheable output fact from an opt-in entry point, for the
calling play to persist (for example vault-encrypted into inventory), counts as handed straight
to the consumer's store, as the gitea and cloudflared `mint` entry points do. Such an entry point
has a confirm flag, refuses under CI environment variables, sets `no_log` on every task, blanks
its intermediates, skips under `--check` and does nothing when the secret already exists.
Keys a host generates for itself and keeps (SSH host keys) are not covered. The README line
"`no_log` is not used: the role handles no secrets" stays only where true. *Why:* nothing leaks
today and a role writing to a secret store stays possible. *Held:* review.
+2 -1
View File
@@ -58,13 +58,14 @@ The input asserts carry `always` (and `assert`), so they run whatever tags are s
## Tests
The `default` molecule scenario runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It replaces the upstream repository with a local stub whose installer only logs its arguments and creates the database file, so it tests the merge, the asserts, the user, the configuration directory and the rendered `pihole.toml` (owner, group and mode), the clone's checked-out version, the installer sequence (install once, then reconfigure from the handler) and idempotence, not Pi-hole itself: no pihole-FTL service runs, so that the service loaded the configuration is not verified. It runs `check` before the converge (a fresh host) and after it (a configured host). Negative tests in `verify.yml` cover a host without Ubuntu facts, a missing `pihole_web_password`, an unset interface, empty upstreams, a non-string password and the placeholder password.
The `default` molecule scenario runs in CI only, on two platforms: `${MOLECULE_IMAGE}` (Ubuntu 24.04) and `${MOLECULE_IMAGE_2604}` (Ubuntu 26.04). It replaces the upstream repository with a local stub whose installer only logs its arguments and creates the database file, so it tests the merge, the asserts, the user, the configuration directory and the rendered `pihole.toml` (owner, group and mode), the clone's checked-out version, the installer sequence (install once, then reconfigure from the handler) and idempotence, not Pi-hole itself: no pihole-FTL service runs, so that the service loaded the configuration is not verified. It runs `check` before the converge (a fresh host) and after it (a configured host). Negative tests in `verify.yml` cover a host without Ubuntu facts, a missing `pihole_web_password`, an unset interface, empty upstreams, a non-string password, the placeholder password and a non-empty app password.
## Notes
- Idempotent: yes.
- Merge model: the role sets an internal fact to `pihole_default | combine(pihole_overrides | default({}), recursive=True)`. The input is only read, never overwritten, so each run recomputes the merge. Dictionaries are not merged across variable sources, so define `pihole_overrides` in one place only.
- Secrets: the password is hashed twice with SHA-256 in the template (`pwhash`). The merge and both template tasks use `no_log`, and the templates `diff: false`, so a `pihole.toml` change shows no diff. `pihole_testing` masks the web password, app password and TOTP secret in its output. `totp_secret` and `app_password` default to empty strings.
- App passwords: `config.webserver.api.app_password` must stay empty, and the role fails otherwise; `app_pwhash` always renders empty, which disables app passwords. Released pihole-FTL upgrades a legacy-hashed (double SHA-256) app password on login by writing the new hash into the main `pwhash`, so one login with the app password would replace the web password.
- Install flow: the role creates the `pihole` system user (nologin), the configuration directory and, on first install, `pihole.toml`, because the unattended installer needs it first. It clones `repo.version` and runs the installer with `--unattended` only when `config.files.database` does not exist yet. A change to `pihole.toml` notifies the `reconfigure pihole` handler, which runs the installer with `--reconfigure --unattended`.
- Updates: the role does not upgrade an installed Pi-hole; changing `repo.version` only moves the clone.
- Check mode: `--check` is the supported preview; a play-level `check_mode: true` is not supported. On a host where the configuration directory does not exist yet, the `pihole.toml` template tasks are skipped under `--check`, because the directory they write into is not created.
+1 -1
View File
@@ -308,7 +308,7 @@ pihole_default:
password: "{{ pihole_web_password }}"
# Pi-hole 2FA TOTP secret.
totp_secret: ""
# Pi-hole application password (to circumvent 2FA for legacy 3rd-party services)
# Pi-hole application password: must stay empty, app_pwhash always renders empty (README Notes)
app_password: ""
# Should application password API sessions be allowed to modify config settings?
app_sudo: false
+7 -3
View File
@@ -13,8 +13,8 @@ argument_specs:
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 and C(config.webserver.api.password) is a string other than
C(changetoyourownpassword).
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
@@ -47,7 +47,11 @@ argument_specs:
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) and C(config.webserver.api.app_password) are also credentials.
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
+8 -1
View File
@@ -56,7 +56,7 @@
database: passwd
key: pihole
- name: The config carries the overridden upstreams and a hashed password
- name: The config carries the overridden upstreams, a hashed password and no app password
ansible.builtin.assert:
that:
- "'9.9.9.9' in pihole_test_toml_content"
@@ -66,6 +66,7 @@
- "'\"eth0\"' not in pihole_test_toml_content"
- "'molecule-test-password' not in pihole_test_toml_content"
- pihole_test_toml_content is search('(?m)^\\s*pwhash = \"[0-9a-f]{64}\"')
- pihole_test_toml_content is search('(?m)^\\s*app_pwhash = \"\"$')
quiet: true
vars:
pihole_test_toml_content: "{{ pihole_test_toml.content | b64decode }}"
@@ -167,3 +168,9 @@
dns: {interface: molecule0}
webserver: {api: {password: changetoyourownpassword}}
expect: placeholder changetoyourownpassword
- name: app-password-set
overrides:
config:
dns: {interface: molecule0}
webserver: {api: {password: molecule-test-password, app_password: molecule-test-app-password}}
expect: app_password must stay empty
+12
View File
@@ -53,3 +53,15 @@
The web password is the placeholder changetoyourownpassword: set pihole_web_password, or
pihole_overrides.config.webserver.api.password, to a secret of your own.
quiet: true
# Released pihole-FTL upgrades a legacy-hashed app password on login by writing the new hash
# into the main pwhash, so the role renders app_pwhash empty, which disables app passwords.
- name: Check that no app password is set
ansible.builtin.assert:
that:
- (__pihole_candidate.config.webserver.api.app_password | default('', true)) == ''
fail_msg: >-
config.webserver.api.app_password must stay empty: released pihole-FTL replaces the main
web password when someone logs in with an app password the role has hashed. Remove
app_password from pihole_overrides.
quiet: true
+3 -3
View File
@@ -838,9 +838,9 @@
#
# Possible values are:
# <valid Pi-hole password hash>
# NOTE! I am assuming this should be double-hashed just like the regular password, but
# this assumption has not been tested!
app_pwhash = "{{ __pihole_effective.config.webserver.api.app_password | hash('sha256') | hash('sha256') }}"
# Always empty, which disables app passwords: the role refuses app_password, because
# released pihole-FTL rewrites the main pwhash on a login with a legacy-hashed app password.
app_pwhash = ""
# Should application password API sessions be allowed to modify config settings?
# Setting this to true allows third-party applications using the application password