test(ci): wire multi-role molecule scenario into pull-request CI#101
Merged
Conversation
sbaerlocher
added a commit
that referenced
this pull request
Jun 26, 2026
The molecule-multi-role CI job failed in the syntax step with "The role 'arillso.agent.alloy' was not found". Under scenarios_root: extensions/molecule the reusable CI runs ansible-playbook --syntax-check from the extensions/ project directory, and Ansible's static `roles:` pre-parse does not add the collection root to the roles search path there — it only lists the scenario-local roles/ dir plus the galaxy defaults, so the arillso.agent.<role> FQCNs do not resolve at syntax time. The per-role default scenarios avoid this because their project directory is roles/<role>, but they reference their own role with the same FQCN. To stay consistent with FQCN usage while fixing resolution, load the three roles via ansible.builtin.include_role instead of a static roles: block. include_role defers FQCN resolution to converge runtime, where molecule's prerun has the collection on the finder path. The pull-request.yml job definition is unchanged. Refs #101 Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
The combined multi-role scenario (extensions/molecule/multi-role, added in #98) deploys alloy, do and tailscale on one host but was not run automatically. Add a molecule-multi-role job (docker driver, like the do/tailscale per-role jobs) so the cross-role interaction is covered on every PR. Document it in AGENTS.md. Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
The molecule-multi-role CI job failed in the syntax step with "The role 'arillso.agent.alloy' was not found". Under scenarios_root: extensions/molecule the reusable CI runs ansible-playbook --syntax-check from the extensions/ project directory, and Ansible's static `roles:` pre-parse does not add the collection root to the roles search path there — it only lists the scenario-local roles/ dir plus the galaxy defaults, so the arillso.agent.<role> FQCNs do not resolve at syntax time. The per-role default scenarios avoid this because their project directory is roles/<role>, but they reference their own role with the same FQCN. To stay consistent with FQCN usage while fixing resolution, load the three roles via ansible.builtin.include_role instead of a static roles: block. include_role defers FQCN resolution to converge runtime, where molecule's prerun has the collection on the finder path. The pull-request.yml job definition is unchanged. Refs #101 Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
The reusable CI runs molecule from `extensions/` (cd dirname of scenarios_root), so Ansible's cwd-based collection autodetection does not reach the collection root and arillso.agent.<role> stays unresolved at converge runtime. Point ANSIBLE_COLLECTIONS_PATH at the dir that contains ansible_collections/ (four levels up from the extensions cwd). Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
molecule runs molecule.yml through string placeholder substitution, so a literal $(...) in a comment raises 'Invalid placeholder in string'. Reword the comment without dollar signs; the ANSIBLE_COLLECTIONS_PATH value itself is a plain relative path. Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
Overriding ANSIBLE_COLLECTIONS_PATH with only the collection-root parent hid the galaxy-installed deps (community.docker, used by molecule's own docker create/destroy playbooks), causing 'couldn't resolve community.docker.docker_container'. Append the default ~/.ansible/collections to the colon-separated list. Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
…CTORY A relative ANSIBLE_COLLECTIONS_PATH resolved differently per molecule phase (molecule changes cwd), so converge still failed to find arillso.agent.<role>. Use the absolute collection root that molecule exposes as MOLECULE_PROJECT_DIRECTORY, three levels up to the dir containing ansible_collections/, plus the default galaxy path for community.docker. Signed-off-by: Simon Bärlocher <s.baerlocher@sbaerlocher.ch>
71ce752 to
defd83d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
molecule-multi-rolejob topull-request.ymlso the combined scenarioextensions/molecule/multi-role/(alloy + do + tailscale on one host, added in #98) runs automatically on every PR. Docker driver, matching thedo/tailscaleper-role jobs. Documents the combined scenario in AGENTS.md.Why
The multi-role scenario existed but was never wired into CI, so the cross-role interaction was only testable manually. Closes the Notion intake card "Integrationstest fuer Multi-Rollen-Playbook".
Test plan
molecule-multi-rolejob converges + verifies all three roles