Author SHA1 Message Date
Defame1297 8497af3407 Merge pull request 'chore(deps): update own ci images' (#504) from renovate/own-ci-images into main
Reviewed-on: #504
2026-12-02 09:29:37 +00:00
renovate-bot 293e4f6f79 chore(deps): update own ci images
renovate/stability-days Updates have met minimum release age requirement
Gitea release key / check (pull_request) Successful in 51s
Build / build (pull_request) Successful in 1m14s
Molecule / select (pull_request) Successful in 18s
Lint / lint (pull_request) Successful in 4m46s
Molecule / scenarios (pull_request) Successful in 36m27s
Molecule / Result (pull_request) Successful in 3s
2026-12-02 08:51:09 +00:00
Defame1297 722e81f233 Merge pull request 'chore(deps): update lint tooling' (#491) from renovate/lint-tooling into main
Images / image (0.1, Dockerfile, ubuntu:24.04@sha256:562111b88caa79c71391c0c4d3c2114a7d5c35915c20561fd893cb1e07929e6b, molecule-ubuntu2404, images/molecule-ubuntu2404) (push) Failing after 14s
Images / image (0.1, Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, molecule-ubuntu2604, images/molecule-ubuntu2604) (push) Successful in 14s
Images / image (0.1, images/molecule-controller/Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, molecule-controller, ) (push) Successful in 2m10s
Images / image (0.2, images/ci/Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, ci, ) (push) Successful in 5m56s
Reviewed-on: #491
2026-12-02 08:42:42 +00:00
Defame1297 570d16d861 Merge branch 'main' into renovate/lint-tooling
Build / build (pull_request) Successful in 38s
Molecule / select (pull_request) Successful in 7s
Molecule / scenarios (pull_request) Skipped
Molecule / Result (pull_request) Successful in 1s
Lint / lint (pull_request) Successful in 2m34s
2026-12-02 08:39:16 +00:00
Defame1297 891deec3a8 Merge pull request 'chore(deps): refresh pip-compile outputs' (#492) from renovate/pip-compile-refresh into main
Images / image (0.1, Dockerfile, ubuntu:24.04@sha256:562111b88caa79c71391c0c4d3c2114a7d5c35915c20561fd893cb1e07929e6b, molecule-ubuntu2404, images/molecule-ubuntu2404) (push) Failing after 18s
Images / image (0.1, Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, molecule-ubuntu2604, images/molecule-ubuntu2604) (push) Successful in 19s
Images / image (0.1, images/molecule-controller/Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, molecule-controller, ) (push) Successful in 17s
Images / image (0.2, images/ci/Dockerfile, ubuntu:26.04@sha256:d66b366dac61b575bee2aef07e9c26e8070096fbe84a3d4d3eb0da069b5d76db, ci, ) (push) Successful in 7m47s
Reviewed-on: #492
2026-12-02 08:33:20 +00:00
Defame1297 ffa4cf5760 Merge branch 'main' into renovate/pip-compile-refresh
Build / build (pull_request) Successful in 36s
Molecule / select (pull_request) Successful in 6s
Molecule / scenarios (pull_request) Skipped
Molecule / Result (pull_request) Successful in 2s
Lint / lint (pull_request) Successful in 3m35s
2026-12-02 08:29:28 +00:00
renovate-bot 3aab89b637 chore(deps): update lint tooling
renovate/stability-days Updates have met minimum release age requirement
Build / build (pull_request) Successful in 1m6s
Lint / lint (pull_request) Successful in 5m29s
Molecule / molecule (pull_request) Successful in 59s
2026-12-02 03:17:49 +00:00
Defame1297 d2db03b48d Merge branch 'main' into renovate/pip-compile-refresh
Build / build (pull_request) Canceled after 1m15s
Lint / lint (pull_request) Successful in 7m13s
Molecule / molecule (pull_request) Successful in 15s
2026-12-01 23:13:04 +00:00
renovate-bot 5c9c5fb713 chore(deps): refresh pip-compile outputs
renovate/stability-days Updates have met minimum release age requirement
Build / build (pull_request) Successful in 1m6s
Lint / lint (pull_request) Successful in 5m27s
Molecule / molecule (pull_request) Successful in 1m33s
2026-11-30 03:19:42 +00:00
28 changed files with 149 additions and 156 deletions

No files matched your search

+4 -4
View File
@@ -53,8 +53,8 @@ issue.
- **Lint and Build run in the pinned `ci` image and compare the pin files with the checksums
baked into it (`/opt/ci-pins.sha256`).** A pull request that changes `requirements-dev.txt`,
`requirements-dev.lock`, `requirements.yml` or `.pre-commit-config.yaml` takes the slow path,
which installs the pinned tools and collections.
`requirements-dev.lock`, `requirements.yml`, `extensions/molecule/requirements.yml` or
`.pre-commit-config.yaml` takes the slow path, which installs the pinned tools and collections.
*Why:* a pull request is tested on its own pins, and an unchanged one starts in seconds.
*Held:* control: the "Check the baked tooling against the pins" step.
- **On the fast path the network is cut by environment**: `PIP_NO_INDEX=1`, the proxy variables
@@ -109,7 +109,7 @@ issue.
(release versions, `build_ignore`) do not change what a scenario runs, and the Build check
proves the collection builds; they had caused about a third of full pull request runs and their
minutes (#338). *Held:* control: `scripts/check_scenarios_load_checkout.py`, which
`run_molecule_in_controller.sh` runs on the selected scenarios before they start, fails the run
`run_molecule_in_ci_image.sh` runs on the selected scenarios before they start, fails the run
when the environment molecule gives `ansible-playbook` resolves `mortis.kamino` anywhere else,
or when `prerun` is not off once the base config is merged as molecule's CLI merges it (a
scenario turns it on, or the base config is moved or turns it on).
@@ -148,7 +148,7 @@ issue.
`requirements-molecule.lock` selects every scenario; `requirements-dev.*` pins only Lint's tools
and selects none. *Why:* a pull request that bumps ansible-core or molecule must run its
scenarios on them before it automerges. *Held:* control: the pin comparison in
`run_molecule_in_controller.sh`, and the selector's tests for which pin files select what.
`run_molecule_in_ci_image.sh`, and the selector's tests for which pin files select what.
- **Every scenario sets `scenario.test_sequence` to molecule's default minus both `destroy`
steps, with a role scenario's `check` right before and right after `converge`, names each
platform `${KAMINO_RUN_ID:-local}-<name>` and labels it
+3 -3
View File
@@ -28,7 +28,7 @@ jobs:
timeout-minutes: 30
# The ci image (images/ci, built by image.yml): tag for the release, digest enforced.
container:
image: git.rkdr.net/mortis/ci:0.2.48@sha256:d1c6653255abf366462c0265d9372626d5b59095084fe74ae95b9ebe7414007d
image: git.rkdr.net/mortis/ci:0.2.51@sha256:376e6319e1304f9fa9da1142e7884e39def496a1467528ccb4fe2d04017822db
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
steps:
@@ -66,8 +66,8 @@ jobs:
HTTP_PROXY=http://127.0.0.1:9 HTTPS_PROXY=http://127.0.0.1:9 no_proxy= NO_PROXY= >> "$GITHUB_ENV"
echo "::notice::Later steps run with a dead proxy; a download fails the job (bake it into images/ci)."
else
echo "::warning::requirements-dev.txt, requirements-dev.lock, requirements.yml" \
"or .pre-commit-config.yaml differ from the ci image;" \
echo "::warning::requirements-dev.txt, requirements-dev.lock, requirements.yml," \
"extensions/molecule/requirements.yml or .pre-commit-config.yaml differ from the ci image;" \
"installing the pinned tools for this run."
/opt/venv/bin/pip install --quiet --require-hashes -r requirements-dev.lock -r requirements-dev.txt
fi
+1 -1
View File
@@ -44,7 +44,7 @@ jobs:
# The ci image (images/ci, built by image.yml), at the pin of lint.yml: tag for the
# release, digest enforced. Only its /opt/venv Python (with PyYAML) is used here.
container:
image: git.rkdr.net/mortis/ci:0.2.48@sha256:d1c6653255abf366462c0265d9372626d5b59095084fe74ae95b9ebe7414007d
image: git.rkdr.net/mortis/ci:0.2.51@sha256:376e6319e1304f9fa9da1142e7884e39def496a1467528ccb4fe2d04017822db
steps:
# The container has no Node, so JavaScript actions such as actions/checkout
# cannot run; clone with git and the job token.
+3 -3
View File
@@ -39,15 +39,15 @@ on: # yamllint disable-line rule:truthy
- main
paths:
- 'images/**'
# The ci image bakes these files' contents in (images/ci/Dockerfile); requirements.yml too.
# The ci image bakes these files' contents in (images/ci/Dockerfile).
- 'requirements-dev.txt'
- 'requirements-dev.lock'
- 'requirements.yml'
- 'extensions/molecule/requirements.yml'
- '.pre-commit-config.yaml'
# The molecule-controller image bakes these, and requirements.yml (its Dockerfile).
# The molecule-controller image bakes these (images/molecule-controller/Dockerfile).
- 'requirements-molecule.txt'
- 'requirements-molecule.lock'
- 'extensions/molecule/requirements.yml'
- '.gitea/workflows/image.yml'
workflow_dispatch: {}
+5 -5
View File
@@ -6,8 +6,8 @@ name: Lint
# The tools come from the ci image (images/ci, built by image.yml): the pinned Python
# tools of requirements-dev.txt, the collections of requirements.yml and the hook
# environments of .pre-commit-config.yaml are baked in. When a PR changes one of those
# files the checksum check below fails and the job installs the pinned tools and
# collections itself for this run (slower, same result).
# files or extensions/molecule/requirements.yml the checksum check below fails and the
# job installs the pinned tools and collections itself for this run (slower, same result).
on: # yamllint disable-line rule:truthy
pull_request:
branches:
@@ -31,7 +31,7 @@ jobs:
# The tag says which release, the digest is what is enforced (bump both together
# when image.yml publishes a new version).
container:
image: git.rkdr.net/mortis/ci:0.2.48@sha256:d1c6653255abf366462c0265d9372626d5b59095084fe74ae95b9ebe7414007d
image: git.rkdr.net/mortis/ci:0.2.51@sha256:376e6319e1304f9fa9da1142e7884e39def496a1467528ccb4fe2d04017822db
env:
PIP_DISABLE_PIP_VERSION_CHECK: "1"
PRE_COMMIT_HOME: /opt/pre-commit
@@ -65,8 +65,8 @@ jobs:
HTTP_PROXY=http://127.0.0.1:9 HTTPS_PROXY=http://127.0.0.1:9 no_proxy= NO_PROXY= >> "$GITHUB_ENV"
echo "::notice::Later steps run with a dead proxy; a download fails the job (bake it into images/ci)."
else
echo "::warning::requirements-dev.txt, requirements-dev.lock, requirements.yml" \
"or .pre-commit-config.yaml differ from the ci image;" \
echo "::warning::requirements-dev.txt, requirements-dev.lock, requirements.yml," \
"extensions/molecule/requirements.yml or .pre-commit-config.yaml differ from the ci image;" \
"installing the pinned tools and collections for this run."
/opt/venv/bin/pip install --quiet --require-hashes -r requirements-dev.lock -r requirements-dev.txt
# --force: the baked copy of a changed pin is replaced, not kept as "already installed".
+4 -4
View File
@@ -64,7 +64,7 @@ jobs:
# The molecule-controller pin, as CONTROLLER_IMAGE below: a ci pin here would make every ci
# bump select every scenario (ADR 0003).
container:
image: git.rkdr.net/mortis/molecule-controller:0.1.1@sha256:94af071ecae858016f9a61afa6e45f8344f8fef7d22d1fe899e05f5f48f756e8
image: git.rkdr.net/mortis/molecule-controller:0.1.3@sha256:4fa8a653e7af673f8e9921068dd504700679cc5bdefbfd55369e9cbca3fa9b44
outputs:
scenarios: ${{ steps.select.outputs.scenarios }}
steps:
@@ -134,7 +134,7 @@ jobs:
# The tools and collections molecule runs with, apart from Lint's (ADR 0003), so a tool
# bump only Lint uses selects no scenario.
CONTROLLER_IMAGE: >-
git.rkdr.net/mortis/molecule-controller:0.1.1@sha256:94af071ecae858016f9a61afa6e45f8344f8fef7d22d1fe899e05f5f48f756e8
git.rkdr.net/mortis/molecule-controller:0.1.3@sha256:4fa8a653e7af673f8e9921068dd504700679cc5bdefbfd55369e9cbca3fa9b44
# Used by the scenarios as `image: ${MOLECULE_IMAGE}`; set it the same way to run
# one locally.
MOLECULE_IMAGE: >-
@@ -220,7 +220,7 @@ jobs:
-v "$ac_root:$ac_root" -v "$ac_root/passwd:/etc/passwd:ro" -w "$PWD" \
-e "AC_ROOT=$ac_root" -e "HOME=$ac_root/home" -e "USER=$(id -un)" \
-e MOLECULE_IMAGE -e MOLECULE_IMAGE_2604 -e KAMINO_RUN_ID -e MOLECULE_LANES \
"$CONTROLLER_IMAGE" scripts/run_molecule_in_controller.sh <<< "$SELECTED"
"$CONTROLLER_IMAGE" scripts/run_molecule_in_ci_image.sh <<< "$SELECTED"
# A cancelled run can leave its containers running when the docker client is killed.
- name: Remove this run's containers
@@ -249,7 +249,7 @@ jobs:
timeout-minutes: 5
# The controller pin again, so this job adds no pin of its own to bump.
container:
image: git.rkdr.net/mortis/molecule-controller:0.1.1@sha256:94af071ecae858016f9a61afa6e45f8344f8fef7d22d1fe899e05f5f48f756e8
image: git.rkdr.net/mortis/molecule-controller:0.1.3@sha256:4fa8a653e7af673f8e9921068dd504700679cc5bdefbfd55369e9cbca3fa9b44
steps:
- name: Check the select and scenarios jobs
env:
@@ -1,5 +0,0 @@
---
trivial:
- >-
ufw - The check-mode probes read whether a command ran instead of whether it was skipped, which
ansible-core 2.25 stops reporting for a command in check mode.
+8 -7
View File
@@ -10,12 +10,13 @@ runs in the [`molecule-controller`](molecule-controller.md) image instead
Ubuntu 26.04 with:
- **Python tools** in `/opt/venv` (on `PATH`; it runs on Python 3.14, the version of `.python-version`, from the baked copy and not from the distribution's `python3`), from `requirements-dev.lock` (the hashed lock of `requirements-dev.txt`, installed with `pip install --require-hashes`): `ansible-core`,
`ansible-lint`, `pre-commit`, `antsibull-changelog`, `galaxy-importer`, `reuse`, `molecule`
(without its Docker driver: Lint's "Test the repository scripts" step runs the tests that import it), and
`proxmoxer`, the controller-side library the modules of `community.proxmox` import.
`ansible-lint`, `pre-commit`, `antsibull-changelog`, `galaxy-importer`, `reuse`, `molecule` and
`molecule-plugins[docker]` (the Docker driver, with the `docker` Python SDK), and `proxmoxer`, the controller-side
library the modules of `community.proxmox` import.
- **The collections the roles call** in `/opt/collections` (`ANSIBLE_COLLECTIONS_PATH` is set to it), from
`requirements.yml`: `community.general`, `ansible.posix` and `community.proxmox` at the exact versions CI tests against, so
`ansible-lint --offline` resolves their modules instead of mocking them.
`ansible-lint --offline` resolves their modules instead of mocking them; and from
`extensions/molecule/requirements.yml`, `community.docker`, which the Molecule Docker driver's own playbooks call.
- **Every pre-commit hook environment** of `.pre-commit-config.yaml` in `/opt/pre-commit`
(`PRE_COMMIT_HOME`): conventional-pre-commit, gitleaks, yamllint, ruff, shellcheck-py, pre-commit-hooks, actionlint and zizmor. The Go
hooks are prebuilt; their toolchains, and the binaries of those repositories that no hook runs, are removed to
@@ -27,7 +28,7 @@ Ubuntu 26.04 with:
`python3`, so sanity runs its compile test for those interpreters instead of skipping it.
- `git`, `shellcheck` (actionlint runs it over `run:` blocks), `python3`, `python3-venv` and `ca-certificates`.
The image runs as root and sets no working directory.
- `/opt/ci-pins.sha256`: the checksums of the four pin files this image was built from.
- `/opt/ci-pins.sha256`: the checksums of the five pin files this image was built from.
It has no Node, so JavaScript actions (`actions/checkout`) cannot run in it: clone with `git`.
@@ -60,8 +61,8 @@ jobs:
pre-commit run --all-files --show-diff-on-failure
```
`/opt/ci-pins.sha256` lists the four pin files by their checkout-relative path, so `sha256sum -c` runs in the checkout root. When
the checkout's `requirements-dev.txt`, `requirements-dev.lock`, `requirements.yml` and `.pre-commit-config.yaml` match, the baked tools and
`/opt/ci-pins.sha256` lists the five pin files by their checkout-relative path, so `sha256sum -c` runs in the checkout root. When
the checkout's `requirements-dev.txt`, `requirements-dev.lock`, `requirements.yml`, `extensions/molecule/requirements.yml` and `.pre-commit-config.yaml` match, the baked tools and
collections are used as they are, and Lint and Build cut the network by environment (proxy variables and
`PIP_NO_INDEX`) for all but the script tests, so a tool that downloads at run time fails the job. When a pull request changes a pin the check fails and the job installs the pinned
tools and collections itself for that run
+1 -1
View File
@@ -33,7 +33,7 @@ checkout). In the checkout root, run `sha256sum --quiet -c /opt/molecule-pins.sh
and collections for that run first (slower, same result), until the image is rebuilt from `main`.
`.gitea/workflows/molecule.yml` is its consumer: it pins the image as `CONTROLLER_IMAGE`, and
`scripts/run_molecule_in_controller.sh` runs the pin check inside it. Read the workflow for the full command.
`scripts/run_molecule_in_ci_image.sh` runs the pin check inside it. Read the workflow for the full command.
## Tags and pinning
+2 -2
View File
@@ -2,8 +2,8 @@
# Collections the Molecule test harness itself calls, as opposed to the roles under test (those are
# in the requirements.yml at the repository root). The Docker driver of molecule-plugins runs
# community.docker modules in its own create and destroy playbooks, so every scenario needs it.
# The molecule-controller image (images/molecule-controller) bakes it into /opt/collections next to the
# root one; a pull request that changes it fails the image's pin check, so the Molecule job installs it itself.
# The ci image (images/ci) bakes it into /opt/collections next to the root one; a pull request that
# changes it fails the image's pin check, so the Molecule job installs it itself.
# Renovate (renovate.json, ansible-galaxy manager) bumps this pin.
collections:
- name: community.docker
+17 -12
View File
@@ -13,13 +13,12 @@
# - OS packages: git, shellcheck (actionlint runs it over run: blocks), the
# distribution's python3 and ca-certificates.
# - /opt/venv: requirements-dev.lock, the hashed lock of requirements-dev.txt (ansible-core, ansible-lint, pre-commit,
# antsibull-changelog, galaxy-importer, reuse, molecule, proxmoxer), on the Python of
# antsibull-changelog, galaxy-importer, reuse, molecule and its Docker driver, proxmoxer), on the Python of
# .python-version (PYTHON_VERSION below), the one the lock was resolved on and a clone's .venv uses.
# molecule is there for Lint's "Test the repository scripts" step, whose molecule tests import it; its
# Docker driver and community.docker are not: Molecule runs in the molecule-controller image.
# - /opt/collections: the collections of requirements.yml (the versions the roles are
# tested against), found through ANSIBLE_COLLECTIONS_PATH, so `ansible-lint --offline`
# resolves their modules without a mock list.
# resolves their modules without a mock list; and those of extensions/molecule/requirements.yml
# (community.docker), which the Molecule Docker driver's own playbooks call.
# - /opt/pre-commit: every hook environment of .pre-commit-config.yaml, installed by
# `pre-commit install-hooks` (gitleaks and actionlint are built from source by
# pre-commit, which downloads a Go toolchain: that is most of the time saved).
@@ -28,8 +27,8 @@
# - Python 3.11, 3.13 and PYTHON_VERSION as python<MINOR> on PATH, so that
# `ansible-test sanity` runs its compile test for them instead of skipping it.
# They come from python-build-standalone through uv, pinned by the uv version.
# - /opt/ci-pins.sha256: the checksums of requirements-dev.txt, requirements-dev.lock, requirements.yml
# and .pre-commit-config.yaml this image was built from. A job runs
# - /opt/ci-pins.sha256: the checksums of requirements-dev.txt, requirements-dev.lock, requirements.yml,
# extensions/molecule/requirements.yml and .pre-commit-config.yaml this image was built from. A job runs
# `sha256sum -c /opt/ci-pins.sha256` in its checkout; when a pull request changes a
# pin the check fails and the job installs the tools as before, until the image
# is rebuilt from main.
@@ -67,6 +66,8 @@ ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
WORKDIR /src
COPY requirements-dev.txt requirements-dev.lock requirements.yml .pre-commit-config.yaml ./
# Kept at its checkout path: its name matches the root requirements.yml.
COPY extensions/molecule/requirements.yml extensions/molecule/
# The interpreters come first: /opt/venv is built from the pinned one (PYTHON_VERSION, kept equal to
# .python-version and to the lock header by `check_image_versions.py pins`), not from the distribution's
@@ -74,7 +75,7 @@ COPY requirements-dev.txt requirements-dev.lock requirements.yml .pre-commit-con
# uv only lives in the build stage (its own venv): the final image keeps the interpreters it
# downloaded, not the installer. The distribution's python3 only bootstraps uv.
RUN python3 -m venv /opt/uv-venv \
&& /opt/uv-venv/bin/pip install uv==0.13.9 \
&& /opt/uv-venv/bin/pip install uv==0.13.10 \
&& /opt/uv-venv/bin/uv python install 3.11 3.13 ${PYTHON_VERSION}
# python-build-standalone ships lib/libpython<MINOR>.so (about 33 MB, 10 MB compressed) next to a statically
@@ -98,11 +99,13 @@ RUN "$(echo /opt/python/cpython-${PYTHON_VERSION}.*/bin/python${PYTHON_VERSION})
&& /opt/venv/bin/python --version \
&& /opt/venv/bin/pip install --require-hashes -r requirements-dev.lock -r requirements-dev.txt
# The collections of requirements.yml. ANSIBLE_COLLECTIONS_PATH is set to the target for the
# The collections of requirements.yml and extensions/molecule/requirements.yml. ANSIBLE_COLLECTIONS_PATH is set to the target for the
# install only: a collection found anywhere else on the path would be skipped as "already
# installed" and not copied here.
RUN ANSIBLE_COLLECTIONS_PATH=/opt/collections \
/opt/venv/bin/ansible-galaxy collection install -r requirements.yml -p /opt/collections \
&& ANSIBLE_COLLECTIONS_PATH=/opt/collections \
/opt/venv/bin/ansible-galaxy collection install -r extensions/molecule/requirements.yml -p /opt/collections \
&& du -sh /opt/collections
# pre-commit needs a git repository to resolve a config. The hook repositories are
@@ -175,7 +178,7 @@ FROM os AS final
ARG PYTHON_VERSION=3.14
LABEL org.opencontainers.image.title="ci" \
org.opencontainers.image.description="CI tooling image for the mortis.kamino Ansible Collection: the Lint and Build workflows run in it, so a job only checks out the code and runs; Molecule runs in the molecule-controller image. It bakes in ansible-core, ansible-lint, pre-commit with every hook environment of the repository, antsibull-changelog, galaxy-importer, reuse, molecule (for the script tests), proxmoxer, the collections of requirements.yml, git, shellcheck, Python 3.11, 3.13 and the version of .python-version (the tools in /opt/venv run on it) next to the distribution python3 and primed ansible-test sanity virtualenvs. Pin it by tag and digest, as a job container or with docker run; it has no Node, so clone with git." \
org.opencontainers.image.description="CI tooling image for the mortis.kamino Ansible Collection: the Lint and Build workflows run in it, so a job only checks out the code and runs; Molecule runs in the molecule-controller image. It bakes in ansible-core, ansible-lint, pre-commit with every hook environment of the repository, antsibull-changelog, galaxy-importer, reuse, molecule with its Docker driver, proxmoxer, the collections of requirements.yml and extensions/molecule/requirements.yml, git, shellcheck, Python 3.11, 3.13 and the version of .python-version (the tools in /opt/venv run on it) next to the distribution python3 and primed ansible-test sanity virtualenvs. Pin it by tag and digest, as a job container or with docker run; it has no Node, so clone with git." \
org.opencontainers.image.source="https://git.rkdr.net/mortis/kamino" \
org.opencontainers.image.url="https://git.rkdr.net/mortis/kamino" \
org.opencontainers.image.documentation="https://git.rkdr.net/mortis/kamino/src/branch/main/docs/images/ci.md" \
@@ -183,7 +186,7 @@ LABEL org.opencontainers.image.title="ci" \
org.opencontainers.image.authors="Defame1297 and contributors" \
org.opencontainers.image.base.name="ubuntu:26.04" \
net.rkdr.mortis.purpose="CI tooling image for the mortis.kamino Ansible Collection: the Lint and Build workflows run in it, so a job only checks out the code and runs." \
net.rkdr.mortis.contents="Ubuntu 26.04, /opt/venv (ansible-core, ansible-lint, pre-commit, antsibull-changelog, galaxy-importer, reuse, molecule, proxmoxer), /opt/collections (community.general, ansible.posix, community.proxmox), /opt/pre-commit hook environments, ansible-test sanity venvs, python3 (distribution), python3.11, python3.13, python<PYTHON_VERSION> (the one of /opt/venv), git, shellcheck, /opt/ci-pins.sha256" \
net.rkdr.mortis.contents="Ubuntu 26.04, /opt/venv (ansible-core, ansible-lint, pre-commit, antsibull-changelog, galaxy-importer, reuse, molecule, molecule-plugins[docker], proxmoxer), /opt/collections (community.general, ansible.posix, community.proxmox, community.docker), /opt/pre-commit hook environments, ansible-test sanity venvs, python3 (distribution), python3.11, python3.13, python<PYTHON_VERSION> (the one of /opt/venv), git, shellcheck, /opt/ci-pins.sha256" \
net.rkdr.mortis.usage="Lint and Build: job container on the kamino-docker runner, git.rkdr.net/mortis/ci:version@sha256:digest with PRE_COMMIT_HOME set to /opt/pre-commit. Run sha256sum -c /opt/ci-pins.sha256 in the checkout root and install the pinned tools and collections when a pull request changed them, else use /opt/venv/bin and ANSIBLE_COLLECTIONS_PATH=/opt/collections. See the documentation label."
ENV PIP_DISABLE_PIP_VERSION_CHECK=1 \
@@ -200,14 +203,16 @@ COPY --from=build /root/.ansible/test /root/.ansible/test
# The target interpreters ansible-test looks for on PATH, and the pin record.
COPY --from=build /src/requirements-dev.txt /src/requirements-dev.lock /src/requirements.yml /src/.pre-commit-config.yaml /opt/ci-pins/
# Under its checkout path, so `sha256sum -c` in a checkout root finds it.
COPY --from=build /src/extensions/molecule/requirements.yml /opt/ci-pins/extensions/molecule/
RUN set -eu; \
for v in $(printf '%s\n' 3.11 3.13 "${PYTHON_VERSION}" | sort -u); do \
ln -sf "$(echo /opt/python/cpython-${v}.*/bin/python${v})" "/usr/local/bin/python${v}"; \
"python${v}" --version; \
done; \
cd /opt/ci-pins; \
sha256sum requirements-dev.txt requirements-dev.lock requirements.yml .pre-commit-config.yaml \
> /opt/ci-pins.sha256; \
sha256sum requirements-dev.txt requirements-dev.lock requirements.yml extensions/molecule/requirements.yml \
.pre-commit-config.yaml > /opt/ci-pins.sha256; \
ansible --version | head -n1; \
ansible-galaxy collection list; \
pre-commit --version; \
+1 -1
View File
@@ -56,7 +56,7 @@ COPY extensions/molecule/requirements.yml extensions/molecule/
# removed when the binary does not link it (about 10 MB compressed nothing here loads), as in ci.
RUN set -eu; \
python3 -m venv /opt/uv-venv; \
/opt/uv-venv/bin/pip install uv==0.13.9; \
/opt/uv-venv/bin/pip install uv==0.13.10; \
/opt/uv-venv/bin/uv python install "${PYTHON_VERSION}"; \
d="$(echo /opt/python/cpython-${PYTHON_VERSION}.*/)"; \
if ldd "${d}bin/python${PYTHON_VERSION}" | grep -q libpython; then \
+59 -40
View File
@@ -193,9 +193,9 @@ ansible-builder==3.2.0 \
--hash=sha256:8cd8639011127aaa5046fd60e56ae753eb599061bf493eca2c6b75c54cfc6212 \
--hash=sha256:9cb948dbd221bdf6d0d48e80fa1575ca5f4336a569c05f510e2d406f01897673
# via galaxy-importer
ansible-compat==26.11.0 \
--hash=sha256:35cbe829e0b5a9acb85d34b8d5da2eb45acaf767f6651f90e0ab2f3a96a060bb \
--hash=sha256:c06a486b39ced440f9f6fb9a99583c73d9239c94ece822a27ea2242173462dda
ansible-compat==26.11.1 \
--hash=sha256:d22e0a48d8d79e727b0f56db3573b02bde2189b5bfbef067230a34c0bcbff94a \
--hash=sha256:ed9717fde1705a58678c1503e46316a36f7392229c2444d2b2f1b6de12be9f25
# via
# ansible-lint
# molecule
@@ -240,9 +240,9 @@ anyio==4.16.0 \
# via
# httpx2
# openai
apm-cli==0.38.1 \
--hash=sha256:c2a0394643e54d3516efefcd78bb043509ac48b65cca1f40166023789b8eb89a \
--hash=sha256:c2ddd1ea95f7223de2ced83c1bbb61b756a10de2651edc76b93346c925dc162b
apm-cli==0.39.1 \
--hash=sha256:af1636869ee0217129549f16d8ac9e645c77af5a6d4fbfc9dbd08e47bdefd0da \
--hash=sha256:b569fea62e19504a8d5fd4983f765241eacebd4d7f64465c105b755450b67b96
# via -r requirements-dev.txt
attrs==23.2.0 \
--hash=sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30 \
@@ -687,6 +687,11 @@ distro==1.9.0 \
# via
# ansible-lint
# bindep
# selinux
docker==7.2.0 \
--hash=sha256:a3f45fdeb9165e2d25d9a1d02ddf3bc70fb572cf5ebbf9b58558c22caf29b71f \
--hash=sha256:cebb93773d334f778e023a7ee352a8d6e13ab1bd3b863a4d4a59dec897df43ac
# via molecule-plugins
docutils==0.23 \
--hash=sha256:25d013af9bf23bc1c7b2b093dff4208166c53a94786c9e447808335ef1185fea \
--hash=sha256:746f5060322511280a1e50eb76846ed6bf2342984b2ac04dc42caa1a8d78799e
@@ -698,9 +703,9 @@ enrich==1.2.7 \
--hash=sha256:0a2ab0d2931dff8947012602d1234d2a3ee002d9a355b5d70be6bf5466008893 \
--hash=sha256:f29b2c8c124b4dbd7c975ab5c3568f6c7a47938ea3b7d2106c8a3bd346545e4f
# via molecule
filelock==4.3.0 \
--hash=sha256:143407310acf479e82d88068e3b9a6486f45fb410c0ed8729fe7359eaabeb6f1 \
--hash=sha256:f933f39f7e01249a4a49b9abab30edc6d4b874624c3de5dd0b0d137aa8adb979
filelock==4.3.2 \
--hash=sha256:02a8801bc6b2a80921bf3d7895c63084d53bae2a3c86783adce5ae2b89a1825b \
--hash=sha256:4f0a21c70447782453c06bb20a9863ee385ead1abaef22049af79289496851b3
# via
# ansible-lint
# apm-cli
@@ -844,9 +849,9 @@ frozenlist==1.8.0 \
# via
# aiohttp
# aiosignal
galaxy-importer==0.4.44 \
--hash=sha256:6c024fed7689f854bc8131d613a677f5929e34b01e2c9d63ac63ec69ae37004c \
--hash=sha256:c2261e6480cb71c445228233f2de906ef96fa5dc55b138a85e5e5a7c30902de7
galaxy-importer==0.4.45 \
--hash=sha256:189204ab6ca8d4f1619ac8eae7bb9867088a48fc31ba13cf0d4b10ff4f4ad857 \
--hash=sha256:ec9d77f95d8e700ad0792fff0fc909e395af963dbd8aa862b1ab30c8bff6f53e
# via -r requirements-dev.txt
gitdb==4.0.12 \
--hash=sha256:5ef71f855d191a3326fcfbc0d5da835f26b13fbcba60c32c21091c349ffdb571 \
@@ -1030,9 +1035,9 @@ llm-github-models==0.18.0 \
--hash=sha256:b0b702c563b6c2f581a707e9b809017c38f094a4d4fffc066e0b56bf209eb281 \
--hash=sha256:b778aa6fa43e53ecb3b868fcf9875bc0e760a774a1fad76ea907a269582a2043
# via apm-cli
markdown==3.11.3 \
--hash=sha256:81eb91631dc97ad1efbc76019ef0f80fe90ca49ddf81546752d79989c3bfff3e \
--hash=sha256:e1a31a112232504d753e5c01bb8c2de90d3f0ba986b063e10770cf7695b09e73
markdown==3.11.4 \
--hash=sha256:2e30b19cead1968f391206e184ca67dfe6805c2eb8f383fb07b4dc90f8288075 \
--hash=sha256:c911a757f33d64a2578bed2d20c57e007b2aedd8a67bceabd593b31143d54ead
# via galaxy-importer
markdown-it-py==4.3.0 \
--hash=sha256:7aa1511a46c39138de78d9eba92ce47e63124d8003fc98b3a351909e04239efa \
@@ -1202,6 +1207,12 @@ mdurl==0.1.2 \
molecule==26.11.1 \
--hash=sha256:34035f2852f1c0461539051ec1dd2398492c1e4f370ba507b81a781f322e4147 \
--hash=sha256:dcd147fb60bb66c060e0bf6a3eaa18f34433a18254a6f56f25ac254fb7980f64
# via
# -r requirements-dev.txt
# molecule-plugins
molecule-plugins==26.11.0 \
--hash=sha256:194be2c43d950545cc699ab19f1a55b26853809e6e8c855ea1a42edacf5c7ee7 \
--hash=sha256:513808288b7027c465b124e66a2a31002c7c907b2fea9002f63ee90bb2d0ef84
# via -r requirements-dev.txt
multidict==7.2.1 \
--hash=sha256:02009b402129a73e1f3da68f48eb999afbacd29f25aef0d5052b84ff5c2786a2 \
@@ -1420,13 +1431,13 @@ nodeenv==1.12.0 \
--hash=sha256:4ea7f88339310afebc3253f2c7a91b94bacf97d73a36a5c108962abdfaca501e \
--hash=sha256:80644d65c10cc2be12e3e4b54b3367ff288c7ad24ae75c2dcc65454fc7449d4d
# via pre-commit
openai==3.57.0 \
--hash=sha256:5a0a89d6a542efc85e2a8cec701ca9265b795d578c777828e10fafdf80e333b6 \
--hash=sha256:f97bc74024c06ced8428b56c4a3594066709d3082779bf9d0b4b6092fbf587a8
openai==3.60.0 \
--hash=sha256:077657587f7d2d55b943a135c3e183f87cf7dc66644caa3c0bbc2bde1fe65de9 \
--hash=sha256:476e79f256a4ce74848b7abae9f074352a69dca6e7e8987d565ee883a3b7e496
# via llm
packaging==26.3 \
--hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \
--hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c
packaging==26.4 \
--hash=sha256:81383611a09c1bc0b08b76e0fd5829d7c6824c65b27a6aee339da133f4233ea2 \
--hash=sha256:c4b671c41ddb9bf26e543c37723610d28fb6bf7affc4da17cf048d419d2c062a
# via
# ansible-builder
# ansible-compat
@@ -1453,9 +1464,9 @@ pbr==7.1.3 \
--hash=sha256:6583e878a1d97cb135fdc509811f31b9235905cde8d4dacd3dbadf9efc45d745 \
--hash=sha256:9a4a85b84e906337708009af0b5f5cdabeeb72d4dc213c9e97974da54fd9acc5
# via bindep
platformdirs==4.14.8 \
--hash=sha256:1e34af590de4d978631b751eb2202f2fee4497537a17c1720b12fcf57b331392 \
--hash=sha256:96893d686e84e9e6f358a9ea41a8de544df66dbf2ba6cda250e7dc73acf85b9b
platformdirs==4.14.9 \
--hash=sha256:c6b188e03ffd4dfe1bf8c4bcb47cd94711af244a9852dbff60297bd753684d5d \
--hash=sha256:d0d3a23e7ff282cfa94b77f5a22b81030dcb68ba0430f90c74f4bd8d090782ea
# via
# black
# virtualenv
@@ -1795,9 +1806,9 @@ python-debian==1.1.1 \
--hash=sha256:f98ae013e8e5310e49041cc3860a7105df73af73d4ff1d8afb474770d328a6ad \
--hash=sha256:fe4fc3dc798dbf1f0ef5865e2b1b4f7cc0352b6a511b25ab7594906c64a73629
# via reuse
python-discovery==1.9.6 \
--hash=sha256:383aa67858d73a9585a843a37a4383c6be98e4d86a981a031328e393a6eb2632 \
--hash=sha256:93b10b90363d4151964cdeee2ec6601f3041b17fc2b253a1c3da7d6e7ddd8337
python-discovery==1.9.8 \
--hash=sha256:4e0c3349272923b6f58db8c5dad111b09dec9d3e2c97f9b79023f8b2e9acf7ab \
--hash=sha256:5d66dd004e6972687438a799fa0895b7a900c1b7324a525196f1826bf7cebb03
# via virtualenv
python-frontmatter==1.3.0 \
--hash=sha256:9f7dd9260bec99044219159a329f64f039087f9d1a2124c9442556f2fe6f82ec \
@@ -1958,7 +1969,9 @@ requests==2.34.2 \
# via
# apm-cli
# azure-core
# docker
# galaxy-importer
# molecule-plugins
resolvelib==1.2.1 \
--hash=sha256:7d08a2022f6e16ce405d60b68c390f054efcfd0477d4b9bd019cc941c28fad1c \
--hash=sha256:fb06b66c8da04172d9e72a21d7d06186d8919e32ae5ab5cdf5b9d920be805ac2
@@ -2126,6 +2139,10 @@ ruamel-yaml==0.19.1 \
# via
# ansible-lint
# apm-cli
selinux==0.3.0 \
--hash=sha256:2a88b337ac46ad0f06f557b2806c3df62421972f766673dd8bf26732fb75a9ea \
--hash=sha256:ecf7add45c939e9dda682c390a2cd0a845c94a4793a2cce9e8870d4ee9501f99
# via molecule-plugins
semantic-version==2.10.0 \
--hash=sha256:bdabb6d336998cbb378d4b9db3a4b56a1e3235701dc05ea2690d9a997ed5041c \
--hash=sha256:de78a3b8e0feda74cabc54aab2da702113e33ac9d9eb9d2389bcf1f58b7d9177
@@ -2148,9 +2165,9 @@ sqlite-fts4==1.0.3 \
--hash=sha256:0359edd8dea6fd73c848989e1e2b1f31a50fe5f9d7272299ff0e8dbaa62d035f \
--hash=sha256:78b05eeaf6680e9dbed8986bde011e9c086a06cb0c931b3cf7da94c214e8930c
# via sqlite-utils
sqlite-utils==4.2.1 \
--hash=sha256:76114b6a5414714e6c70e5fa5c4781b301b590f6951b5da39c8cc60c21382ba1 \
--hash=sha256:7fbaee670713b25eceba05779b844f0895efaf680d9a226fa5ba7dfe165721c5
sqlite-utils==4.2.2 \
--hash=sha256:5c54dc4d77260b44e8d0ccf4461c321c40ca1451dd6b6a63398ed058722aff13 \
--hash=sha256:e92aa6c2bcefa1877cbd56e8da6fe3924ca5b45954f98e7d738c49d19325fa0d
# via llm
subprocess-tee==0.4.2 \
--hash=sha256:21942e976715af4a19a526918adb03a8a27a8edab959f2d075b777e3d78f532d \
@@ -2166,9 +2183,9 @@ toml==0.10.2 \
--hash=sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b \
--hash=sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f
# via apm-cli
tomlkit==0.15.2 \
--hash=sha256:05562412163a3037b94497385fb7f9204c637bc605af7a48199e41cf2272f437 \
--hash=sha256:83e32755ba1d20d9340bd069ee97e9f6232ba2346b63ffcba425de01f7e327a6
tomlkit==0.15.3 \
--hash=sha256:a83ce6de3b648e68dd9b50aabadad749ba823eb58b1d026f3c0a283c4767a9c1 \
--hash=sha256:b3c3020ec1a4bd469d12e31fb4da938e7f6ba758cdbec3fd9047db63120eaf81
# via
# apm-cli
# reuse
@@ -2179,9 +2196,9 @@ truststore==0.10.5 \
# apm-cli
# httpcore2
# httpx2
typer==0.29.2 \
--hash=sha256:b1998dc5f2c3dedafa1517a9521fa944cc4dc1fadcea085d81a3b10ebcaeb075 \
--hash=sha256:f30731f8ca758368b836b3714872e58e395cef8fcaff918c853b1969ed5274e7
typer==0.29.3 \
--hash=sha256:1fd37275046faecc86caa2e0e313978c10db71533fc0fe1a48f4e03a60efc23c \
--hash=sha256:8189a53bb9684dc551e0b61e71904b323214884f2eb14bfe71aa859ae980d10a
# via rstcheck
typing-extensions==4.16.0 \
--hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \
@@ -2206,10 +2223,12 @@ tzdata==2026.6 \
urllib3==2.8.0 \
--hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 \
--hash=sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63
# via requests
virtualenv==21.15.12 \
--hash=sha256:a3976f886eb6019fcb1d137b223d160adaeff524ab0ad785c729a43c31cc158c \
--hash=sha256:bbbf764388a18dee8c3532c77af7a29680cd8121911d6dcb3484335d76547323
# via
# docker
# requests
virtualenv==21.15.14 \
--hash=sha256:6c6e7aaf88064767c75c32a9df92eaa425cee5db4cc21caf031a78d89375d57f \
--hash=sha256:816503d7826a2269abc03f7f0dd48ffd3b63db1958a7a3cbeea5a70dd7fe0ff1
# via pre-commit
watchdog==7.1.1 \
--hash=sha256:05e85c22dcd53f7152d1e03e785e241341d586b06a5115be7c0ea86436ccc1f6 \
+5 -6
View File
@@ -1,4 +1,4 @@
# Pinned tooling for Lint and Build, used by CI (.gitea/workflows) and locally:
# Pinned tooling for lint, build and Molecule, used by CI (.gitea/workflows) and locally:
# python3 -m venv .venv && . .venv/bin/activate && pip install --require-hashes -r requirements-dev.lock -r requirements-dev.txt
# This file holds the direct pins; requirements-dev.lock is their hashed lock (every transitive
# package too, with the sha256 of each release file) and is what gets installed; pip refuses an
@@ -10,14 +10,13 @@ ansible-core==2.22.0
ansible-lint==26.10.1
pre-commit==4.7.0
antsibull-changelog==0.38.0
galaxy-importer==0.4.44
galaxy-importer==0.4.45
reuse==6.3.0
# molecule without its Docker driver: Lint's "Test the repository scripts" step imports it in
# test_check_scenarios_load_checkout.py and test_run_molecule_scenarios.py, which skip without it.
molecule==26.11.1
molecule-plugins[docker]==26.11.0
# proxmoxer: the controller-side library community.proxmox's modules import (they refuse anything below 2.3),
# so lint runs where a consumer's controller would.
# so lint and Molecule run where a consumer's controller would.
proxmoxer==2.3.0
# apm-cli: for changing apm.yml (run apm install, commit the lock). Keep it at 0.36.1 or later (#252):
# before 0.29.0, `apm audit --ci` compares the whole .claude/settings.json and fails on any hand-written key.
apm-cli==0.38.1
apm-cli==0.39.1
+2 -3
View File
@@ -2,9 +2,8 @@
# Collections the roles of this Collection call (the dependencies of galaxy.yml, pinned exactly).
# galaxy.yml holds the lower bounds a consumer needs; this file holds the versions CI tests
# against. One file feeds every consumer, so they cannot drift apart:
# - the ci image (images/ci/Dockerfile) bakes it into /opt/collections for Lint;
# - the molecule-controller image (images/molecule-controller/Dockerfile) bakes it for Molecule,
# and scripts/run_molecule_in_controller.sh installs it itself when a pull request changes it;
# - the ci image (images/ci/Dockerfile) bakes it into /opt/collections for Lint and Molecule;
# - the Molecule job (.gitea/workflows/molecule.yml) installs it itself when a pull request changes it;
# - scripts/dev-setup.sh installs it into .ansible/collections for local lint.
# Renovate (renovate.json, ansible-galaxy manager) bumps these pins.
collections:
+1 -1
View File
@@ -45,7 +45,7 @@ There is no discovery by variable name, and a variable that looks like one fails
### `service_rules`
A service role that owns firewall rules calls the role with `include_role` and `tasks_from: service_rules` after the main entry has run, with `apply: {tags: [...]}` so `--tags <role>` reaches these tasks. The entry point installs nothing and touches no default policy, no `before.rules` and no base rule. Outside check mode (`--check` or the `check_mode` keyword; the role detects it with a probe command that does not run there, not `ansible_check_mode`) it fails when ufw is not installed and active. In check mode it skips the reconcile only when `ufw status` fails (ufw not installed yet, the main entry may not have reached the host); a host with ufw installed but inactive is reconciled as usual.
A service role that owns firewall rules calls the role with `include_role` and `tasks_from: service_rules` after the main entry has run, with `apply: {tags: [...]}` so `--tags <role>` reaches these tasks. The entry point installs nothing and touches no default policy, no `before.rules` and no base rule. Outside check mode (`--check` or the `check_mode` keyword; the role detects it with a skipped probe task, not `ansible_check_mode`) it fails when ufw is not installed and active. In check mode it skips the reconcile only when `ufw status` fails (ufw not installed yet, the main entry may not have reached the host); a host with ufw installed but inactive is reconciled as usual.
| Variable | Default | Required | Description |
|---|---|---|---|
+1 -1
View File
@@ -68,7 +68,7 @@
# svc_o2 that looks like the SSH rule, and a rule of svc_m. The managed owners below are
# the ones used above plus svc_m (listed but never called), so svc_o1 and svc_o2 are
# orphans. The cases that must change nothing run first and the purge last, so the
# idempotence run finds nothing left to delete. Under --check the role's own check-mode probe
# idempotence run finds nothing left to delete. Under --check the role's own skipped probe
# keeps the purge from deleting, and orphan_check.yml skips its counts.
- name: Report and purge the rules of unmanaged owners
hosts: all
+2 -2
View File
@@ -474,8 +474,8 @@
# apply of community.general.ufw reports changed for the would-be rule, so molecule's
# idempotence run (a second converge) would fail on it. Verify runs once, outside that count.
# The play runs under the check_mode keyword, which does not set ansible_check_mode in the
# included role; the role detects check mode with a probe task instead (a command does
# not run under the keyword). A present call that would add a rule and an absent call for an
# included role; the role detects check mode with a probe task instead (a command task is
# skipped under the keyword). A present call that would add a rule and an absent call for an
# owner that holds rules must change nothing. The two reads of the rule list are forced to
# run (check_mode: false) and compared as a whole.
- name: Check mode of service_rules changes nothing
+4 -4
View File
@@ -6,10 +6,10 @@
state: present
register: __ufw_install
# Not ansible_check_mode, which the play-level `check_mode: true` keyword does not set in include_role
# tasks, nor `is skipped`, which ansible-core 2.25 drops: the probe's stdout is empty in check mode.
# ansible_check_mode is not used: the play-level `check_mode: true` keyword does not set it inside
# include_role tasks. A command task is skipped in both forms, the same probe as tasks/sysctl.yml.
- name: Probe whether the run is in check mode
ansible.builtin.command: echo ran
ansible.builtin.command: "true"
register: __ufw_install_probe
changed_when: false
@@ -17,4 +17,4 @@
# Undefined when this file's tags are skipped; the guards then default it to true.
- name: Remember whether ufw can be configured
ansible.builtin.set_fact:
__ufw_can_configure: "{{ __ufw_install is not changed or __ufw_install_probe.stdout == 'ran' }}"
__ufw_can_configure: "{{ __ufw_install is not changed or __ufw_install_probe is not skipped }}"
+5 -4
View File
@@ -63,16 +63,17 @@
the rule tags): {{ ufw_managed_owners }}
quiet: true
# Not ansible_check_mode, which the play-level `check_mode: true` keyword does not set in include_role
# tasks, nor `is skipped`, which ansible-core 2.25 drops: the probe's stdout is empty in check mode.
# ansible_check_mode is not used: the play-level `check_mode: true` keyword does not set
# that magic variable inside include_role tasks (only --check does). A command task is
# skipped in both forms and its result says so, which is the one signal that holds for both.
- name: Probe whether the run is in check mode
ansible.builtin.command: echo ran
ansible.builtin.command: "true"
register: ufw_oa_probe
changed_when: false
- name: Remember whether the run is in check mode
ansible.builtin.set_fact:
ufw_oa_check: "{{ ufw_oa_probe.stdout != 'ran' }}"
ufw_oa_check: "{{ ufw_oa_probe is skipped }}"
- name: Read the firewall status
become: true
+5 -4
View File
@@ -121,16 +121,17 @@
- ufw_manage_rules
tags: [ufw, ufw_service_rules]
block:
# Not ansible_check_mode, which the play-level `check_mode: true` keyword does not set in include_role
# tasks, nor `is skipped`, which ansible-core 2.25 drops: the probe's stdout is empty in check mode.
# ansible_check_mode is not used: the play-level `check_mode: true` keyword does not set
# that magic variable inside include_role tasks (only --check does). A command task is
# skipped in both forms and its result says so, which is the one signal that holds for both.
- name: Probe whether the run is in check mode
ansible.builtin.command: echo ran
ansible.builtin.command: "true"
register: ufw_sr_probe
changed_when: false
- name: Remember whether the run is in check mode
ansible.builtin.set_fact:
ufw_sr_check: "{{ ufw_sr_probe.stdout != 'ran' }}"
ufw_sr_check: "{{ ufw_sr_probe is skipped }}"
- name: Read the firewall status
become: true
+5 -4
View File
@@ -7,17 +7,18 @@
check_mode: false
when: ufw_enabled and ufw_sysctl_overrides | length > 0
# Not ansible_check_mode, which the play-level `check_mode: true` keyword does not set in include_role
# tasks, nor `is skipped`, which ansible-core 2.25 drops: the probe's stdout is empty in check mode.
# ansible_check_mode is not used: the play-level `check_mode: true` keyword does not set that
# magic variable inside include_role tasks (only --check does). A command task
# is skipped in both forms and its result says so, the same probe as tasks/service_rules.yml.
- name: Probe whether the run is in check mode
ansible.builtin.command: echo ran
ansible.builtin.command: "true"
register: ufw_sysctl_probe
changed_when: false
when: ufw_enabled and ufw_sysctl_overrides | length > 0
- name: Remember whether the run is in check mode
ansible.builtin.set_fact:
ufw_sysctl_check: "{{ ufw_sysctl_probe.stdout != 'ran' }}"
ufw_sysctl_check: "{{ ufw_sysctl_probe is skipped }}"
when: ufw_enabled and ufw_sysctl_overrides | length > 0
# In check mode on a fresh host ufw is not installed yet, so the file is absent.
+4 -16
View File
@@ -70,18 +70,9 @@ USER_AGENT = "kamino-next-image-version"
class RegistryError(Exception):
def __init__(self, url, status, text, challenge="", codes=()):
def __init__(self, url, status, text, challenge=""):
super().__init__(f"GET {url}: HTTP {status}: {text}")
self.status, self.challenge, self.codes = status, challenge, codes
def _error_codes(raw):
"""The OCI error codes of an error body (`{"errors": [{"code": ...}]}`), or () for any other body."""
try:
errors = json.loads(raw).get("errors") or []
return tuple(e.get("code") for e in errors if isinstance(e, dict))
except (ValueError, AttributeError, TypeError):
return ()
self.status, self.challenge = status, challenge
def _readable(raw):
@@ -101,9 +92,7 @@ def _fetch(url, headers):
except urllib.error.HTTPError as exc:
raw = exc.read(20000).decode("utf-8", errors="replace")
challenge = exc.headers.get("WWW-Authenticate", "")
raise RegistryError(
url, exc.code, _readable(raw), challenge, _error_codes(raw)
) from exc
raise RegistryError(url, exc.code, _readable(raw), challenge) from exc
class Registry:
@@ -150,8 +139,7 @@ class Registry:
body, headers = self._get(path)
except RegistryError as exc:
# A repository not pushed yet is 404 NAME_UNKNOWN (OCI distribution spec): no tags.
# Any other 404, such as a wrong registry path, must fail rather than restart at .0.
if exc.status == 404 and "NAME_UNKNOWN" in exc.codes and not tags:
if exc.status == 404 and not tags:
return []
raise
tags += body.get("tags") or []
@@ -7,7 +7,7 @@
# writable for the runner user) and put them first, then check that the scenarios on stdin load this
# checkout and run them. CI_BASE_PYTHON is a test seam.
#
# AC_ROOT=<dir holding ansible_collections> scripts/run_molecule_in_controller.sh < scenario-dirs
# AC_ROOT=<dir holding ansible_collections> scripts/run_molecule_in_ci_image.sh < scenario-dirs
set -euo pipefail
selected="$(cat)"
+2 -3
View File
@@ -511,12 +511,11 @@ class PureTest(unittest.TestCase):
)
self.assertEqual(civ.dockerfile_labels('FROM c\nLABEL a="unbalanced\n'), {})
def test_the_molecule_collections_are_not_an_input_of_the_ci_image(self):
# Lint uses no collection of them, so their bump must not publish a ci version.
def test_the_molecule_collections_are_an_input_of_the_ci_image(self):
root = pathlib.Path(__file__).resolve().parents[2]
entry = civ.matrix_of((root / civ.MATRIX_FILE).read_text())["ci"]
files = civ.inputs_of(entry, (root / entry["dockerfile"]).read_text())[1]
self.assertNotIn("extensions/molecule/requirements.yml", files)
self.assertIn("extensions/molecule/requirements.yml", files)
def test_the_controller_pins_are_inputs_of_the_controller_image(self):
root = pathlib.Path(__file__).resolve().parents[2]
-15
View File
@@ -105,7 +105,6 @@ class FakeRegistry(http.server.BaseHTTPRequestHandler):
no_realm = False
empty_token = False
unknown = False # the repository does not exist yet
not_found = None # a 404 body without NAME_UNKNOWN
agents = None # a fresh list per test, set in setUp
def do_GET(self):
@@ -129,8 +128,6 @@ class FakeRegistry(http.server.BaseHTTPRequestHandler):
b"{}",
extra={"WWW-Authenticate": f'Bearer realm="{realm}",service="reg"'},
)
elif self.not_found is not None:
self.reply(404, self.not_found, "text/plain")
elif self.unknown:
body = {"errors": [{"code": "NAME_UNKNOWN", "message": "unknown"}]}
self.reply(404, json.dumps(body).encode())
@@ -158,7 +155,6 @@ class RegistryClient(unittest.TestCase):
def setUp(self):
FakeRegistry.refuse = FakeRegistry.refuse_token = FakeRegistry.no_realm = False
FakeRegistry.empty_token = FakeRegistry.unknown = False
FakeRegistry.not_found = None
FakeRegistry.agents = []
server = QuietServer(("127.0.0.1", 0), FakeRegistry)
threading.Thread(target=server.serve_forever, daemon=True).start()
@@ -180,17 +176,6 @@ class RegistryClient(unittest.TestCase):
niv.next_version("0.1", self.registry.tags(), "c", no_label), "0.1.0"
)
def test_a_404_without_name_unknown_is_a_registry_error(self):
for body in (
b"404 page not found",
b'{"errors":[{"code":"NOT_FOUND","message":"no such route"}]}',
):
with self.subTest(body=body):
FakeRegistry.not_found = body
with self.assertRaises(niv.RegistryError) as caught:
self.registry.tags()
self.assertEqual(caught.exception.status, 404)
def test_a_missing_manifest_is_still_a_registry_error(self):
FakeRegistry.unknown = True
with self.assertRaises(niv.RegistryError) as caught:
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: Defame1297 and contributors
# SPDX-License-Identifier: GPL-3.0-or-later
"""Tests for scripts/run_molecule_in_controller.sh with stub tools in place of the molecule-controller
"""Tests for scripts/run_molecule_in_ci_image.sh with stub tools in place of the molecule-controller
image's.
Run with: python3 -m unittest discover -s tests/scripts
@@ -14,7 +14,7 @@ import tempfile
import unittest
REPO = pathlib.Path(__file__).resolve().parents[2]
SCRIPT = REPO / "scripts" / "run_molecule_in_controller.sh"
SCRIPT = REPO / "scripts" / "run_molecule_in_ci_image.sh"
# Each stub appends its name, arguments and the paths it saw to STUB_LOG; STUB_FAIL_<name> fails it.
STUB = """#!/usr/bin/env bash
@@ -50,7 +50,7 @@ echo "runner args=$* path=$PATH acp=$ANSIBLE_COLLECTIONS_PATH" \\
@unittest.skipUnless(shutil.which("bash"), "bash is required")
class RunMoleculeInControllerTest(unittest.TestCase):
class RunMoleculeInCiImageTest(unittest.TestCase):
def setUp(self):
self.tmp = pathlib.Path(tempfile.mkdtemp(prefix="kamino-runci-")).resolve()
self.addCleanup(shutil.rmtree, self.tmp, True)
+1 -1
View File
@@ -616,7 +616,7 @@ class WorkflowJobsTest(unittest.TestCase):
self.assertEqual(
step["env"]["SELECTED"], "${{ needs.select.outputs.scenarios }}"
)
self.assertIn('run_molecule_in_controller.sh <<< "$SELECTED"', step["run"])
self.assertIn('run_molecule_in_ci_image.sh <<< "$SELECTED"', step["run"])
def test_the_result_runs_whatever_the_others_ended_as(self):
job = self.JOBS["result"]