Commit Graph
3 Commits
Author SHA1 Message Date
Dragonish 3a5040aae8 fix: read getent results through ansible_facts in two verify plays
Build / build (pull_request) Successful in 30s
Lint / lint (pull_request) Successful in 2m52s
Molecule / molecule (pull_request) Successful in 44m53s
The pihole and user_management scenarios read getent_passwd and
getent_shadow as top-level variables. The getent module returns them as
facts, which are injected as variables only while inject_facts_as_vars
is on, so with the setting this pull request turns on in the molecule
job the two verify plays failed (exit 2 in both runs of this pull
request, whose per-scenario logs were not printed).

They now read ansible_facts['getent_passwd'] and
ansible_facts['getent_shadow']. The remaining module-returned facts in
roles/ and extensions/ (package_facts, service_facts, the getent read in
user_management's ssh_keys.yml) are already read through ansible_facts.

Assisted-by: Claude Code:claude-sonnet-5-5
2026-11-26 23:58:23 +00:00
Defame1297 71ae86dc61 test(pihole): assert the config directory, group and clone version
verify.yml now checks the group of pihole.toml, the owner, group and mode
of /etc/pihole, and that the clone is checked out at the repo.version the
converge used, read from the role defaults. The molecule.yml comment
describes the test sequence accurately.

Assisted-by: Claude Code:claude-opus-5-5
2026-11-25 18:58:16 +00:00
Defame1297 bf6f9b5800 test(pihole): add the default molecule scenario
Build / build (pull_request) Successful in 27s
Lint / lint (pull_request) Successful in 2m7s
Molecule / molecule (pull_request) Failing after 2m27s
Runs on noble and resolute without the real Pi-hole: the clone target
is a local git repository whose installer is a stub that logs its
arguments and creates the database file.

Covers a check run before the converge and after idempotence, the
merge, the rendered pihole.toml (upstreams, interface, hashed
password, owner and mode), the system user, the installer sequence
(install once, then reconfigure from the handler) and a negative test
for every validation: no Ubuntu facts, a missing pihole_web_password,
an unset interface, empty upstreams, a non-string and a placeholder
password. No pihole-FTL service runs, so the loaded configuration is
not verified.

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