Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee129a2982 | ||
|
|
35cedf5163 | ||
|
|
bb0bf78964 | ||
|
|
dc7d3bdfd9 | ||
|
|
6f73021d3f | ||
|
|
9d365f14ae | ||
|
|
44cd287d41 | ||
|
|
8def6cf274 | ||
|
|
da76e995b6 | ||
|
|
0d0fc3d1ec | ||
|
|
87b87dbcef | ||
|
|
efd3a550c5 | ||
|
|
5364f18728 | ||
|
|
62ffae7764 |
No files matched your search
@@ -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.43@sha256:373c3ba69e3cdccdf6acf96d9c1cbfa173d2db0fbda441f4256eb46bd3ce6b99
|
||||
image: git.rkdr.net/mortis/ci:0.2.44@sha256:ba153980c5824b81c62eb3cfc871694d126bc6c4c21814813a0fde87873494f6
|
||||
env:
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
||||
steps:
|
||||
|
||||
@@ -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.43@sha256:373c3ba69e3cdccdf6acf96d9c1cbfa173d2db0fbda441f4256eb46bd3ce6b99
|
||||
image: git.rkdr.net/mortis/ci:0.2.44@sha256:ba153980c5824b81c62eb3cfc871694d126bc6c4c21814813a0fde87873494f6
|
||||
steps:
|
||||
# The container has no Node, so JavaScript actions such as actions/checkout
|
||||
# cannot run; clone with git and the job token.
|
||||
|
||||
@@ -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.43@sha256:373c3ba69e3cdccdf6acf96d9c1cbfa173d2db0fbda441f4256eb46bd3ce6b99
|
||||
image: git.rkdr.net/mortis/ci:0.2.44@sha256:ba153980c5824b81c62eb3cfc871694d126bc6c4c21814813a0fde87873494f6
|
||||
env:
|
||||
PIP_DISABLE_PIP_VERSION_CHECK: "1"
|
||||
PRE_COMMIT_HOME: /opt/pre-commit
|
||||
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
env:
|
||||
# The tools and collections molecule runs with: the image Lint and Build use.
|
||||
CI_IMAGE: >-
|
||||
git.rkdr.net/mortis/ci:0.2.43@sha256:373c3ba69e3cdccdf6acf96d9c1cbfa173d2db0fbda441f4256eb46bd3ce6b99
|
||||
git.rkdr.net/mortis/ci:0.2.44@sha256:ba153980c5824b81c62eb3cfc871694d126bc6c4c21814813a0fde87873494f6
|
||||
# Used by the scenarios as `image: ${MOLECULE_IMAGE}`; set it the same way to run
|
||||
# one locally.
|
||||
MOLECULE_IMAGE: >-
|
||||
@@ -62,7 +62,7 @@ jobs:
|
||||
# The same for Ubuntu 26.04, the release the hosts are moving to; used by
|
||||
# `image: ${MOLECULE_IMAGE_2604}` in extensions/molecule/image-smoke-2604.
|
||||
MOLECULE_IMAGE_2604: >-
|
||||
git.rkdr.net/mortis/molecule-ubuntu2604:0.1.6@sha256:d7c216b33d18fa8f1ecbfee8795eb4adc867fe5ad8e7a73b7c67effe301cf771
|
||||
git.rkdr.net/mortis/molecule-ubuntu2604:0.1.7@sha256:86ee99fe77ab4c9af3911570ae7238ce525375cfaf923e9656860606c47488df
|
||||
# Names and labels this run's containers: the scenarios' as `${KAMINO_RUN_ID:-local}-<name>`
|
||||
# with the label net.rkdr.mortis.molecule-run, and the one molecule runs in.
|
||||
KAMINO_RUN_ID: ${{ github.run_id }}-${{ github.run_attempt }}
|
||||
|
||||
@@ -20,8 +20,10 @@ collections:
|
||||
version: v2.1.0
|
||||
```
|
||||
|
||||
Its dependencies (`community.general`, `ansible.posix`) are declared in `galaxy.yml`, so
|
||||
`ansible-galaxy` installs them unless the same file already pins a satisfying version.
|
||||
Its dependencies (`community.general`, `ansible.posix`, `community.proxmox`) are declared in `galaxy.yml`, so
|
||||
`ansible-galaxy` installs them unless the same file already pins a satisfying version. The modules of
|
||||
`community.proxmox` also need the Python library `proxmoxer` 2.3 or later on the controller
|
||||
(`pip install 'proxmoxer>=2.3'`); `galaxy.yml` cannot declare a Python dependency.
|
||||
|
||||
```yaml
|
||||
- ansible.builtin.include_role:
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
minor_changes:
|
||||
- >-
|
||||
galaxy.yml - Declare ``community.proxmox`` (>=2.1.0) as a dependency, needed by ``pve_lxc``.
|
||||
Its modules need the Python library ``proxmoxer`` 2.3 or later on the controller.
|
||||
+3
-2
@@ -9,9 +9,10 @@ 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` and
|
||||
`molecule-plugins[docker]` (the Docker driver, with the `docker` Python SDK).
|
||||
`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` and `ansible.posix` at the exact versions CI tests against, so
|
||||
`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; 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`
|
||||
|
||||
@@ -12,7 +12,9 @@ It is the release the hosts are moving to; the roles are tested on it next to 24
|
||||
`ca-certificates`.
|
||||
- Python for Ansible on the target: `python3`, `python3-apt`, `python3-systemd`.
|
||||
- The packages the roles manage, preinstalled so a converge makes no network calls:
|
||||
`iptables`, `ufw`, `fail2ban`, `openssh-server` (the `ssh` unit is enabled).
|
||||
`iptables`, `ufw`, `fail2ban`, `openssh-server` (the `ssh` unit is enabled), and `gnupg`
|
||||
(the docker scenario signs its stand-in APT repository with it).
|
||||
- root's `sudo` skips the PAM account check (`pam_rootok`), so `become` works in the container.
|
||||
- Throwaway SSH host keys and a machine-id generated at build time. They are not secrets and the
|
||||
image is a test target that must never be exposed to a network.
|
||||
|
||||
|
||||
@@ -57,3 +57,14 @@
|
||||
- name: NET_ADMIN is granted, so the firewall tools can work
|
||||
ansible.builtin.command: iptables -S
|
||||
changed_when: false
|
||||
|
||||
- name: Run a task with become, as the role scenarios do
|
||||
ansible.builtin.command: id -u
|
||||
become: true
|
||||
changed_when: false
|
||||
register: kamino_smoke_become
|
||||
|
||||
- name: Become reaches root
|
||||
ansible.builtin.assert:
|
||||
that: kamino_smoke_become.stdout == '0'
|
||||
quiet: true
|
||||
+4
-1
@@ -22,10 +22,13 @@ homepage: https://git.rkdr.net/mortis/kamino
|
||||
issues: https://git.rkdr.net/mortis/kamino/issues
|
||||
# CI tests the versions pinned in requirements.yml; the lower bounds here are not tested.
|
||||
# No upper bound, so a consumer's newer pin does not conflict. community.general is used by system_baseline and ufw,
|
||||
# ansible.posix by system_baseline and user_management.
|
||||
# ansible.posix by system_baseline and user_management, community.proxmox by pve_lxc (Proxmox VE guest lifecycle).
|
||||
# community.proxmox's modules import the Python library proxmoxer (2.3 or later) on the controller; galaxy.yml
|
||||
# cannot declare a Python dependency, so the README says it and requirements-dev.txt pins it for CI.
|
||||
dependencies:
|
||||
community.general: ">=14.0.0"
|
||||
ansible.posix: ">=2.2.0"
|
||||
community.proxmox: ">=2.1.0"
|
||||
build_ignore:
|
||||
# Repository tooling that is not part of the Collection. scripts/check_tarball.py fails
|
||||
# the build if anything outside its allowlist ends up in the archive, so a new top-level
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# - 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 and its Docker driver), 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.
|
||||
# - /opt/collections: the collections of requirements.yml (the versions the roles are
|
||||
# tested against), found through ANSIBLE_COLLECTIONS_PATH, so `ansible-lint --offline`
|
||||
@@ -177,7 +177,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, Build and Molecule workflows run in it, so a job only checks out the code and runs. 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, 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.description="CI tooling image for the mortis.kamino Ansible Collection: the Lint, Build and Molecule workflows run in it, so a job only checks out the code and runs. 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" \
|
||||
@@ -185,7 +185,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, Build and Molecule 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, molecule-plugins[docker]), /opt/collections (community.general, ansible.posix, 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.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. Molecule (host executor, kamino-molecule runner): docker run as the runner user, with the Docker socket and the checkout mounted at the same path. In both, 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 \
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
# One RUN layer: about 30 MB compressed on top of the 29.8 MB base (estimated from
|
||||
# the real .debs, with the .pyc files the postinst scripts compile), far below
|
||||
# Cloudflare's 100 MB request-body limit on git.rkdr.net (kaniko pushes a layer as
|
||||
# one request). apt packages are not version-pinned, as in the original image; the
|
||||
# one request; gnupg adds a few MB, not measured). apt packages are not version-pinned, as in the original image; the
|
||||
# base image is pinned by digest and a rebuild is a reviewed digest bump downstream.
|
||||
#
|
||||
# The image carries SSH host keys and a machine-id generated at build time (the
|
||||
@@ -36,7 +36,7 @@ LABEL org.opencontainers.image.title="molecule-ubuntu2604" \
|
||||
org.opencontainers.image.authors="Defame1297 and contributors" \
|
||||
org.opencontainers.image.base.name="ubuntu:26.04" \
|
||||
net.rkdr.mortis.purpose="Disposable Ubuntu 26.04 test target for the molecule scenarios of the mortis.kamino Ansible Collection." \
|
||||
net.rkdr.mortis.contents="Ubuntu 26.04, systemd, systemd-sysv, dbus, sudo, iproute2, ca-certificates, python3, python3-apt, python3-systemd, iptables, ufw, fail2ban, openssh-server (ssh enabled)" \
|
||||
net.rkdr.mortis.contents="Ubuntu 26.04, systemd, systemd-sysv, dbus, sudo, iproute2, ca-certificates, python3, python3-apt, python3-systemd, iptables, ufw, fail2ban, openssh-server (ssh enabled), gnupg" \
|
||||
net.rkdr.mortis.usage="Molecule docker-driver platform with pre_build_image true, command /sbin/init, cgroupns_mode host, /sys/fs/cgroup mounted rw, tmpfs on /run and /run/lock, capability NET_ADMIN, security_opts apparmor=unconfined (not privileged). Pin git.rkdr.net/mortis/name:version@sha256:digest. See the documentation label."
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
@@ -44,15 +44,22 @@ ENV DEBIAN_FRONTEND=noninteractive
|
||||
# systemd as PID 1 with D-Bus, sudo and networking tools; the Python Ansible needs on
|
||||
# the target (python3-apt for the apt module); the firewall and intrusion-prevention
|
||||
# packages the roles manage (python3-systemd is a dependency of fail2ban's systemd
|
||||
# backend); sshd, enabled so a converge can test it under systemd.
|
||||
# backend); sshd, enabled so a converge can test it under systemd; gnupg, which the docker
|
||||
# scenario signs its stand-in APT repository with and which would otherwise cost it an
|
||||
# apt update and install in every run.
|
||||
# root's sudo (Ansible's become here) skips pam_unix's account check, whose unix_chkpwd
|
||||
# helper fails inside the container; non-root callers still go through pam_unix.
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
systemd systemd-sysv dbus sudo iproute2 ca-certificates \
|
||||
python3 python3-apt python3-systemd \
|
||||
iptables ufw fail2ban \
|
||||
openssh-server \
|
||||
gnupg \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& systemctl enable ssh
|
||||
&& systemctl enable ssh \
|
||||
&& sed -i '0,/^@include common-account/s//account sufficient pam_rootok.so\n@include common-account/' /etc/pam.d/sudo \
|
||||
&& grep -qx 'account sufficient pam_rootok.so' /etc/pam.d/sudo
|
||||
|
||||
STOPSIGNAL SIGRTMIN+3
|
||||
CMD ["/sbin/init"]
|
||||
+12
-3
@@ -214,10 +214,14 @@ ansible-lint==26.10.1 \
|
||||
# via
|
||||
# -r requirements-dev.txt
|
||||
# galaxy-importer
|
||||
antsibull-changelog==0.37.0 \
|
||||
--hash=sha256:649105fe6ccd4f035688c4e2e580573660712af1e46f8c0d3d8891352ffc7e2e \
|
||||
--hash=sha256:c9fb0e7625b208ae4ea6fe3633bc0dbeb029bcd2a79da36a8ef7f5a256beadc4
|
||||
antsibull-changelog==0.38.0 \
|
||||
--hash=sha256:674989862b8518ad14bb3ba2b149dc4d70f180666102e0f104864efa6f62ae21 \
|
||||
--hash=sha256:a37d7cd00943e97ed076eb9426a7cd5cd675b247209300ea719948ceaddc9d63
|
||||
# via -r requirements-dev.txt
|
||||
antsibull-docs-loader==1.0.0 \
|
||||
--hash=sha256:92ec1647c24e9006efe7bb7525f3087b9ac70c878da2f2a1b105e7485fd7b240 \
|
||||
--hash=sha256:c1c08623c14d3fc02add4b927678690174f8a082543ea0a48fd61e3647dcd053
|
||||
# via antsibull-changelog
|
||||
antsibull-docs-parser==1.2.3 \
|
||||
--hash=sha256:0d4835c615b6ae1b64d219d42260c2e1b58b6312809599e8e1a63adf7797e968 \
|
||||
--hash=sha256:66d593ad90d5499112cc3167fb178bfa787b496eb883102dfe12a4a4047406ba
|
||||
@@ -1619,6 +1623,10 @@ propcache==0.5.4 \
|
||||
# via
|
||||
# aiohttp
|
||||
# yarl
|
||||
proxmoxer==2.3.0 \
|
||||
--hash=sha256:0b0b2067187af1fc6d4257a46ac68c8fd79cc25d2813637cdae7a9a98fbfd11f \
|
||||
--hash=sha256:1c03445e95cf9c53b6e50614dbaf561e0e1eb3ec878cf45ddde4bc4421c56743
|
||||
# via -r requirements-dev.txt
|
||||
puremagic==2.3.0 \
|
||||
--hash=sha256:15ce035fe4c3f23e884a105d07448a5a81dd2e297985bdb636928ddf89bb3fe7 \
|
||||
--hash=sha256:b54e4a69dd37c50bacc879380f132382ab4e9a935529628c8975abcc73e10640
|
||||
@@ -1939,6 +1947,7 @@ pyyaml==6.0.4 \
|
||||
# ansible-compat
|
||||
# ansible-core
|
||||
# ansible-lint
|
||||
# antsibull-docs-loader
|
||||
# antsibull-fileutils
|
||||
# apm-cli
|
||||
# galaxy-importer
|
||||
|
||||
@@ -9,11 +9,14 @@
|
||||
ansible-core==2.22.0
|
||||
ansible-lint==26.10.1
|
||||
pre-commit==4.7.0
|
||||
antsibull-changelog==0.37.0
|
||||
antsibull-changelog==0.38.0
|
||||
galaxy-importer==0.4.44
|
||||
reuse==6.3.0
|
||||
molecule==26.11.0
|
||||
molecule-plugins[docker]==26.11.0
|
||||
# proxmoxer: the controller-side library community.proxmox's modules import (they refuse anything below 2.3),
|
||||
# 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.37.0
|
||||
@@ -11,3 +11,5 @@ collections:
|
||||
version: 14.0.1
|
||||
- name: ansible.posix
|
||||
version: 2.2.2
|
||||
- name: community.proxmox
|
||||
version: 2.1.0
|
||||
Reference in new issue
Block a user