--- - 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