molecule's idempotence step reruns converge.yml, so plays that only prove a role refuses bad input ran twice and added nothing the second time. The ufw, sshd, gitea and traefik scenarios now keep only the plays that apply the role in converge.yml; the refusal plays and gitea's child ansible-playbook guard checks run once, first in verify.yml. Every existing assertion runs after them, so verify still proves a refused run left the host unchanged. Assisted-by: Claude Code:claude-opus-5-5
26 lines
1.0 KiB
YAML
26 lines
1.0 KiB
YAML
---
|
|
# Run by verify.yml in a child ansible-playbook process, because the mint guard
|
|
# reads the controller's environment (lookup env), which a play cannot change; the
|
|
# child gets its environment from the task that starts it, so the result does not
|
|
# depend on what the runner exports. With the CI variable set it fails at the CI
|
|
# guard; with them blank and gitea_api_token passed it is a no-op and ends green.
|
|
- name: Mint with a controlled environment
|
|
hosts: localhost
|
|
connection: local
|
|
gather_facts: false
|
|
tasks:
|
|
- name: Run the mint entry point
|
|
ansible.builtin.include_role:
|
|
name: mortis.kamino.gitea
|
|
tasks_from: mint
|
|
vars:
|
|
gitea_mint_confirm: true
|
|
# Required by the mint argument spec, which is validated before the guard. The
|
|
# child process uses `-i localhost,` and so does not see the molecule group_vars.
|
|
gitea_admin_user: molecule-admin
|
|
|
|
- name: No token fact was registered
|
|
ansible.builtin.assert:
|
|
that: gitea_minted_api_token is not defined
|
|
quiet: true
|