boma/roles/dev_env/molecule/default/converge.yml
sjat 718781053f fix(dev_env): make concern tags reach included tasks (O8)
Dynamic include_tasks only filter on the include's own tags, not their
(untagged) contents — so `--tags packages` ran none of the neovim/oh-my-posh/
nodejs installs, and `--tags users|config` never entered per_user.yml. Add
`apply: tags:` to all four includes (mirroring base/tasks/main.yml) and tag the
dev_env__home getent+set_fact preflight `always` so a partial run still resolves
the home dir before the dotfile/stow tasks consume it.

Molecule: add a config-only converge play for a fresh user + a verify assertion.
Proven with `molecule converge -- --tags config` (idempotent, home resolved).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 19:06:15 +02:00

44 lines
1.3 KiB
YAML

---
- name: Converge
hosts: all
become: true
gather_facts: true
vars:
dev_env__users:
- tester
pre_tasks:
# `always` so the test user exists even under a partial `--tags` converge.
- name: Create a test user to receive the environment
ansible.builtin.user:
name: tester
create_home: true
tags: [always]
roles:
- role: dev_env
# Partial-tags regression guard (O8): apply only the `config` concern to a fresh user.
# The dev_env__home preflight is tagged `always`, so a config-only run must still resolve
# the home dir and stow the dotfiles. Run the true partial path with:
# molecule converge -- --tags config
# (a full `molecule test` runs every tag, which still exercises this play idempotently).
- name: Converge — config concern only, fresh user
hosts: all
become: true
gather_facts: true
vars:
dev_env__users:
- tagtester
pre_tasks:
# `always` so the test user exists even under a partial `--tags config` converge.
- name: Create a second test user for the config-only path
ansible.builtin.user:
name: tagtester
create_home: true
tags: [always]
tasks:
- name: Apply dev_env restricted to the config concern
ansible.builtin.include_role:
name: dev_env
apply:
tags: [config]
tags: [config]