boma/roles/dev_env/molecule/default/converge.yml

45 lines
1.3 KiB
YAML
Raw Normal View History

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