The installed check carried only updates-only and the merge kept its own default tag, so skipping either left a fact undefined that untagged tasks read. Both now run under always alone, and the README Tags section no longer names updates-only, which selected nothing else. Assisted-by: Claude Code:claude-opus-5-5
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
---
|
|
# Validation first, under always, so a bad input fails before any change whatever tags the
|
|
# run selects.
|
|
- name: Validate the role inputs
|
|
ansible.builtin.import_tasks: validate.yml
|
|
tags: [always, assert]
|
|
|
|
# Fact-only, under always: every later task reads the merged settings, so skipping a tag
|
|
# must not skip the merge.
|
|
- name: Merge configuration defaults
|
|
ansible.builtin.import_tasks: merge-defaults.yml
|
|
tags: always
|
|
|
|
- name: Set Pi-Hole version variable
|
|
ansible.builtin.set_fact:
|
|
__pihole_version: "{{ __pihole_effective.repo.version }}"
|
|
|
|
# Fact-only, under always: the configuration and installation tasks read it.
|
|
- name: Check if Pi-Hole is already installed
|
|
ansible.builtin.stat:
|
|
path: "{{ __pihole_effective.config.files.database }}"
|
|
register: __pihole_database
|
|
tags: always
|
|
|
|
- name: Set Pi-Hole installation status
|
|
ansible.builtin.set_fact:
|
|
__pihole_installed: "{{ __pihole_database.stat.exists | default(false) }}"
|
|
tags: always
|
|
|
|
# Read by the template tasks: under --check the directory is not created, so on a first run
|
|
# there is no directory to render pihole.toml into. Under always, because one reader is
|
|
# untagged and the other tagged config-only.
|
|
- name: Check whether the Pi-Hole configuration directory exists
|
|
ansible.builtin.stat:
|
|
path: "{{ __pihole_effective.config.files.database | dirname }}"
|
|
register: __pihole_config_dir
|
|
tags: always
|
|
|
|
- name: Configure Pi-Hole
|
|
ansible.builtin.import_tasks: configure.yml
|
|
|
|
- name: Install Pi-Hole
|
|
ansible.builtin.import_tasks: install.yml
|
|
|
|
- name: Reconfigure Pi-Hole
|
|
ansible.builtin.import_tasks: reconfigure.yml
|
|
tags: config-only
|