From efe204829f711ce8a8387f533386aa8ffc0c25b1 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Thu, 27 Aug 2026 13:27:31 +0300 Subject: [PATCH] Symlink the shared requirements into each Molecule scenario Molecule checks for a requirements file at the scenario's default path before it installs anything, and warns "Missing roles requirements file" when it is absent - so `requirements-file` pointing elsewhere was silently ignored and the galaxy roles were never installed. CI failed on a missing ansible-role-docker; the local run passed only because those roles were already in ~/.ansible/roles from earlier work, which is exactly the kind of difference a clean CI run exists to expose. A symlink satisfies Molecule's check while keeping one copy of the pins. Co-Authored-By: Claude Opus 5 (1M context) --- docs/molecule-testing.md | 2 +- .../matrix-alertmanager-receiver/molecule/default/molecule.yml | 2 +- .../molecule/default/requirements.yml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 120000 roles/custom/matrix-alertmanager-receiver/molecule/default/requirements.yml diff --git a/docs/molecule-testing.md b/docs/molecule-testing.md index c05e903d9..d1a46f2e9 100644 --- a/docs/molecule-testing.md +++ b/docs/molecule-testing.md @@ -57,7 +57,7 @@ Role defaults are out of scope there, so any path it reads has to be pinned in t `molecule-shared/` holds what would otherwise be duplicated into every role: - `requirements.txt` — the Python packages, for both CI and `just molecule`. -- `requirements.yml` — the external Ansible roles and collections the scenarios need. +- `requirements.yml` — the external Ansible roles and collections the scenarios need. Each scenario symlinks its own `molecule/default/requirements.yml` at this file: Molecule checks for a requirements file at that default path before it will install anything, so pointing at the shared one through `requirements-file` alone is silently ignored. - `vars.yml` — helper container images used for probing, pinned once. They carry `# renovate:` annotations and a custom manager in `.github/renovate.json` keeps them current. A helper image is used to reach a role's container over its own container network. That indirection is deliberate: the roles publish no host port, matching a real deployment, and publishing one for the test would collide between scenarios running in parallel. diff --git a/roles/custom/matrix-alertmanager-receiver/molecule/default/molecule.yml b/roles/custom/matrix-alertmanager-receiver/molecule/default/molecule.yml index a4ef12d6e..f4cc17671 100644 --- a/roles/custom/matrix-alertmanager-receiver/molecule/default/molecule.yml +++ b/roles/custom/matrix-alertmanager-receiver/molecule/default/molecule.yml @@ -6,7 +6,7 @@ dependency: name: galaxy options: - requirements-file: ../../../../../molecule-shared/requirements.yml + requirements-file: requirements.yml force: true driver: name: docker diff --git a/roles/custom/matrix-alertmanager-receiver/molecule/default/requirements.yml b/roles/custom/matrix-alertmanager-receiver/molecule/default/requirements.yml new file mode 120000 index 000000000..1567a5392 --- /dev/null +++ b/roles/custom/matrix-alertmanager-receiver/molecule/default/requirements.yml @@ -0,0 +1 @@ +../../../../../molecule-shared/requirements.yml \ No newline at end of file