Selaa lähdekoodia

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) <noreply@anthropic.com>
pull/5575/head
Slavi Pantaleev 1 päivä sitten
vanhempi
commit
efe204829f
3 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. +1
    -1
      docs/molecule-testing.md
  2. +1
    -1
      roles/custom/matrix-alertmanager-receiver/molecule/default/molecule.yml
  3. +1
    -0
      roles/custom/matrix-alertmanager-receiver/molecule/default/requirements.yml

+ 1
- 1
docs/molecule-testing.md Näytä tiedosto

@@ -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.


+ 1
- 1
roles/custom/matrix-alertmanager-receiver/molecule/default/molecule.yml Näytä tiedosto

@@ -6,7 +6,7 @@
dependency:
name: galaxy
options:
requirements-file: ../../../../../molecule-shared/requirements.yml
requirements-file: requirements.yml
force: true
driver:
name: docker


+ 1
- 0
roles/custom/matrix-alertmanager-receiver/molecule/default/requirements.yml Näytä tiedosto

@@ -0,0 +1 @@
../../../../../molecule-shared/requirements.yml

Ladataan…
Peruuta
Tallenna