system_baseline (#114, 1.3.0) is the first role that calls modules from other collections: community.general.locale_gen and .timezone, and ansible.posix.sysctl and .mount. galaxy.yml now declares community.general >=14.0.0 and ansible.posix >=2.2.0.
Lint: the Lint job runs ansible-lint --offline in the ci image, which has no collections, so these modules could not be resolved (syntax-check[unknown-module]). They are listed in mock_modules in .ansible-lint as a stopgap, so lint does not check those tasks' module arguments.
Local runs: local ansible-lint resolved them from a user-wide collections path, which had community.general 13.5.0, not the 14.0.0 that CI tests against. The local result differed from CI (the shared-state problem of #80).
Molecule: it reads a collections directory provisioned on the runner. The environment repo's gitea_runner role installs that directory from the environment repo's own requirements.yml, so Kamino's tests depend on pins Kamino does not own.
mock_roles is a separate stopgap. CI checks the Collection out outside an ansible_collections/mortis/kamino path, so the scenarios' FQCN role names do not resolve.
Proposal
Add a Kamino-owned requirements.yml with exact pins (currently community.general 14.0.0, ansible.posix 2.2.2), tracked by Renovate.
Install it into the ci image with ansible-galaxy collection install -r requirements.yml -p /opt/collections and set ANSIBLE_COLLECTIONS_PATH. Add the file to /opt/ci-pins.sha256, so a PR that changes a pin falls back to installing at run time, the same way as requirements-dev.txt. Lint stays --offline. Drop mock_modules.
Let Molecule install from the same file instead of the runner-provisioned /opt/molecule-collections.
Have scripts/dev-setup.sh install the pins into a project-local ANSIBLE_HOME, so local lint matches CI (part of #80).
Separately: check the repo out or link it under ansible_collections/mortis/kamino in the Lint job and drop mock_roles.
Tradeoff
Every collection bump becomes an image version bump plus a pin PR, one more step in an already long release chain.
Acceptance
.ansible-lint has no mock_modules (and, after step 5, no mock_roles).
Lint, Molecule and the local hooks resolve the same collection versions, from this repo's pins.
## Problem
`system_baseline` (#114, 1.3.0) is the first role that calls modules from other collections: `community.general.locale_gen` and `.timezone`, and `ansible.posix.sysctl` and `.mount`. `galaxy.yml` now declares `community.general >=14.0.0` and `ansible.posix >=2.2.0`.
- **Lint:** the Lint job runs `ansible-lint --offline` in the `ci` image, which has no collections, so these modules could not be resolved (`syntax-check[unknown-module]`). They are listed in `mock_modules` in `.ansible-lint` as a stopgap, so lint does not check those tasks' module arguments.
- **Local runs:** local `ansible-lint` resolved them from a user-wide collections path, which had `community.general` 13.5.0, not the 14.0.0 that CI tests against. The local result differed from CI (the shared-state problem of #80).
- **Molecule:** it reads a collections directory provisioned on the runner. The environment repo's `gitea_runner` role installs that directory from the environment repo's own `requirements.yml`, so Kamino's tests depend on pins Kamino does not own.
`mock_roles` is a separate stopgap. CI checks the Collection out outside an `ansible_collections/mortis/kamino` path, so the scenarios' FQCN role names do not resolve.
## Proposal
1. Add a Kamino-owned `requirements.yml` with exact pins (currently `community.general` 14.0.0, `ansible.posix` 2.2.2), tracked by Renovate.
2. Install it into the `ci` image with `ansible-galaxy collection install -r requirements.yml -p /opt/collections` and set `ANSIBLE_COLLECTIONS_PATH`. Add the file to `/opt/ci-pins.sha256`, so a PR that changes a pin falls back to installing at run time, the same way as `requirements-dev.txt`. Lint stays `--offline`. Drop `mock_modules`.
3. Let Molecule install from the same file instead of the runner-provisioned `/opt/molecule-collections`.
4. Have `scripts/dev-setup.sh` install the pins into a project-local `ANSIBLE_HOME`, so local lint matches CI (part of #80).
5. Separately: check the repo out or link it under `ansible_collections/mortis/kamino` in the Lint job and drop `mock_roles`.
## Tradeoff
Every collection bump becomes an image version bump plus a pin PR, one more step in an already long release chain.
## Acceptance
- `.ansible-lint` has no `mock_modules` (and, after step 5, no `mock_roles`).
- Lint, Molecule and the local hooks resolve the same collection versions, from this repo's pins.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Done; closing. All five steps landed, and the acceptance holds on main (checked in the CI runs after the merges, not only locally).
What landed
Kamino-owned pins:requirements.yml (community.general 14.0.0, ansible.posix 2.2.2), tracked by Renovate's ansible-galaxy manager. The bot-diff gate lets a bot change only its version: lines. (#121)
Baked into the ci image:/opt/collections, found through ANSIBLE_COLLECTIONS_PATH, and the file is in /opt/ci-pins.sha256, so a PR that changes a pin installs them for its own run. mock_modules is gone from .ansible-lint. (#121, image fixes in #123)
Molecule installs from the same file instead of the runner's /opt/molecule-collections, cached on the runner by checksum. The Docker driver's own collection (community.docker) is pinned separately in extensions/molecule/requirements.yml, because it is a test-harness dependency and the roles do not call it. (#121, fix in the same PR)
scripts/dev-setup.sh installs the pins into .ansible/collections of the clone, and the ansible-lint hook (scripts/ansible-lint.sh) uses them when ANSIBLE_COLLECTIONS_PATH is unset, also from a bare pre-commit run. (#121, #126)
mock_roles is gone: the same wrapper links the checkout as ansible_collections/<namespace>/<name> in a temporary directory, so the scenarios' FQCN role names resolve and the converge plays are linted against the real roles. (#126)
Pin-follow PRs: #125 (ci 0.2.17) and #127 (ci 0.2.18). lint.yml and build.yml now pin ci:0.2.18@sha256:ff30bb7f…66a8.
Acceptance
.ansible-lint has no mock_modules and no mock_roles.
Lint, Molecule and the local hooks resolve the same collection versions, from this repository's pins. On main the Lint job prints The pin files match the ci image; using the baked tools. and passes ansible-lint with no mock list; Molecule passes with the pinned collections.
Tradeoff, as the issue said
Every collection bump is now an image version bump plus a pin PR. The ci image build prints the compressed size of each layer directory (/opt/pre-commit 58 MB, /opt/python 62 MB, /opt/venv 44 MB, /opt/collections 3 MB), which is the number the 100 MB limit applies to.
Things that came up on the way
The Molecule scenarios failed after #121 because dropping the runner's collections directory also dropped community.docker; fixed in the same PR.
The first 0.2.16 image push got a 413 from Cloudflare (the /opt/pre-commit layer passed 100 MB with the new ruff and shellcheck environments). The unused Go binaries that pre-commit installs next to gitleaks and actionlint are now deleted. (#123)
ansible-test sanity reports findings that ruff and the other hooks do not, and failed #126's Build check on a name only its pylint disallows. A pre-push hook now runs it on HEAD. (#126)
Not changed: renovate.json's other rules, the molecule image pins, and the other open issues.
Done; closing. All five steps landed, and the acceptance holds on `main` (checked in the CI runs after the merges, not only locally).
## What landed
1. **Kamino-owned pins:** `requirements.yml` (community.general 14.0.0, ansible.posix 2.2.2), tracked by Renovate's `ansible-galaxy` manager. The bot-diff gate lets a bot change only its `version:` lines. (#121)
2. **Baked into the `ci` image:** `/opt/collections`, found through `ANSIBLE_COLLECTIONS_PATH`, and the file is in `/opt/ci-pins.sha256`, so a PR that changes a pin installs them for its own run. `mock_modules` is gone from `.ansible-lint`. (#121, image fixes in #123)
3. **Molecule installs from the same file** instead of the runner's `/opt/molecule-collections`, cached on the runner by checksum. The Docker driver's own collection (`community.docker`) is pinned separately in `extensions/molecule/requirements.yml`, because it is a test-harness dependency and the roles do not call it. (#121, fix in the same PR)
4. **`scripts/dev-setup.sh`** installs the pins into `.ansible/collections` of the clone, and the `ansible-lint` hook (`scripts/ansible-lint.sh`) uses them when `ANSIBLE_COLLECTIONS_PATH` is unset, also from a bare `pre-commit run`. (#121, #126)
5. **`mock_roles` is gone:** the same wrapper links the checkout as `ansible_collections/<namespace>/<name>` in a temporary directory, so the scenarios' FQCN role names resolve and the converge plays are linted against the real roles. (#126)
Pin-follow PRs: #125 (`ci` 0.2.17) and #127 (`ci` 0.2.18). `lint.yml` and `build.yml` now pin `ci:0.2.18@sha256:ff30bb7f…66a8`.
## Acceptance
- `.ansible-lint` has no `mock_modules` and no `mock_roles`.
- Lint, Molecule and the local hooks resolve the same collection versions, from this repository's pins. On `main` the Lint job prints `The pin files match the ci image; using the baked tools.` and passes `ansible-lint` with no mock list; Molecule passes with the pinned collections.
## Tradeoff, as the issue said
Every collection bump is now an image version bump plus a pin PR. The `ci` image build prints the compressed size of each layer directory (`/opt/pre-commit` 58 MB, `/opt/python` 62 MB, `/opt/venv` 44 MB, `/opt/collections` 3 MB), which is the number the 100 MB limit applies to.
## Things that came up on the way
- The Molecule scenarios failed after #121 because dropping the runner's collections directory also dropped `community.docker`; fixed in the same PR.
- The first 0.2.16 image push got a 413 from Cloudflare (the `/opt/pre-commit` layer passed 100 MB with the new ruff and shellcheck environments). The unused Go binaries that pre-commit installs next to `gitleaks` and `actionlint` are now deleted. (#123)
- `ansible-test sanity` reports findings that ruff and the other hooks do not, and failed #126's Build check on a name only its pylint disallows. A `pre-push` hook now runs it on `HEAD`. (#126)
Not changed: `renovate.json`'s other rules, the molecule image pins, and the other open issues.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
system_baseline(#114, 1.3.0) is the first role that calls modules from other collections:community.general.locale_genand.timezone, andansible.posix.sysctland.mount.galaxy.ymlnow declarescommunity.general >=14.0.0andansible.posix >=2.2.0.ansible-lint --offlinein theciimage, which has no collections, so these modules could not be resolved (syntax-check[unknown-module]). They are listed inmock_modulesin.ansible-lintas a stopgap, so lint does not check those tasks' module arguments.ansible-lintresolved them from a user-wide collections path, which hadcommunity.general13.5.0, not the 14.0.0 that CI tests against. The local result differed from CI (the shared-state problem of #80).gitea_runnerrole installs that directory from the environment repo's ownrequirements.yml, so Kamino's tests depend on pins Kamino does not own.mock_rolesis a separate stopgap. CI checks the Collection out outside anansible_collections/mortis/kaminopath, so the scenarios' FQCN role names do not resolve.Proposal
requirements.ymlwith exact pins (currentlycommunity.general14.0.0,ansible.posix2.2.2), tracked by Renovate.ciimage withansible-galaxy collection install -r requirements.yml -p /opt/collectionsand setANSIBLE_COLLECTIONS_PATH. Add the file to/opt/ci-pins.sha256, so a PR that changes a pin falls back to installing at run time, the same way asrequirements-dev.txt. Lint stays--offline. Dropmock_modules./opt/molecule-collections.scripts/dev-setup.shinstall the pins into a project-localANSIBLE_HOME, so local lint matches CI (part of #80).ansible_collections/mortis/kaminoin the Lint job and dropmock_roles.Tradeoff
Every collection bump becomes an image version bump plus a pin PR, one more step in an already long release chain.
Acceptance
.ansible-linthas nomock_modules(and, after step 5, nomock_roles).🤖 Generated with Claude Code
Done; closing. All five steps landed, and the acceptance holds on
main(checked in the CI runs after the merges, not only locally).What landed
requirements.yml(community.general 14.0.0, ansible.posix 2.2.2), tracked by Renovate'sansible-galaxymanager. The bot-diff gate lets a bot change only itsversion:lines. (#121)ciimage:/opt/collections, found throughANSIBLE_COLLECTIONS_PATH, and the file is in/opt/ci-pins.sha256, so a PR that changes a pin installs them for its own run.mock_modulesis gone from.ansible-lint. (#121, image fixes in #123)/opt/molecule-collections, cached on the runner by checksum. The Docker driver's own collection (community.docker) is pinned separately inextensions/molecule/requirements.yml, because it is a test-harness dependency and the roles do not call it. (#121, fix in the same PR)scripts/dev-setup.shinstalls the pins into.ansible/collectionsof the clone, and theansible-linthook (scripts/ansible-lint.sh) uses them whenANSIBLE_COLLECTIONS_PATHis unset, also from a barepre-commit run. (#121, #126)mock_rolesis gone: the same wrapper links the checkout asansible_collections/<namespace>/<name>in a temporary directory, so the scenarios' FQCN role names resolve and the converge plays are linted against the real roles. (#126)Pin-follow PRs: #125 (
ci0.2.17) and #127 (ci0.2.18).lint.ymlandbuild.ymlnow pinci:0.2.18@sha256:ff30bb7f…66a8.Acceptance
.ansible-linthas nomock_modulesand nomock_roles.mainthe Lint job printsThe pin files match the ci image; using the baked tools.and passesansible-lintwith no mock list; Molecule passes with the pinned collections.Tradeoff, as the issue said
Every collection bump is now an image version bump plus a pin PR. The
ciimage build prints the compressed size of each layer directory (/opt/pre-commit58 MB,/opt/python62 MB,/opt/venv44 MB,/opt/collections3 MB), which is the number the 100 MB limit applies to.Things that came up on the way
community.docker; fixed in the same PR./opt/pre-commitlayer passed 100 MB with the new ruff and shellcheck environments). The unused Go binaries that pre-commit installs next togitleaksandactionlintare now deleted. (#123)ansible-test sanityreports findings that ruff and the other hooks do not, and failed #126's Build check on a name only its pylint disallows. Apre-pushhook now runs it onHEAD. (#126)Not changed:
renovate.json's other rules, the molecule image pins, and the other open issues.