--- # "pihole_overrides" is only read here: the merged result goes into the fact # "__pihole_effective", so the input is never overwritten and every run recomputes the merge. # https://docs.ansible.com/ansible/latest/collections/ansible/builtin/combine_filter.html - name: Merge overrides over the default variable tags: default ansible.builtin.set_fact: __pihole_effective: "{{ pihole_default | combine(pihole_overrides | default({}), recursive=True) }}" # the merged settings hold the web password no_log: true # the web password, app password and TOTP secret are masked so the dump is # safe to paste into an issue or leave in CI logs - name: Inspect the merged settings (secrets masked) ansible.builtin.debug: msg: "{{ __pihole_effective | combine({'config': {'webserver': {'api': __pihole_masked_secrets}}}, recursive=True) }}" vars: __pihole_masked_secrets: {password: , app_password: , totp_secret: } when: pihole_testing | bool - name: Pausing to highlight merge result ansible.builtin.wait_for: timeout: "{{ pihole_testing_timeout | default(5) }}" when: pihole_testing | bool