-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Title: Create Fedora 43 Ansible base image and GitHub Actions site.yml test job
Goal
Provide a reusable Fedora 43 base container for GitHub Actions, preinstalled with Python and Ansible, and a simple CI job that runs ansible/site.yml as a smoke test.
Base image requirements
Create a Dockerfile (e.g. ./.github/docker/fedora-ansible-43.Dockerfile) that:
-
Uses
fedora:43as the base image. -
Runs
dnf -y upgradeto update all packages. -
Installs:
python3python3-pipansible(Fedora package, notpip).
-
Cleans up
dnfcaches to keep the image small.
Publish this image to GHCR so Actions jobs can use it directly:
-
Image name:
ghcr.io/<org>/<repo>/fedora-ansible-43-ansible:latest -
Add a workflow job (e.g.
build-ansible-base-image) that:- Logs into GHCR using
GITHUB_TOKEN. - Builds from
./.github/docker/fedora-ansible-43.Dockerfile. - Tags and pushes the image to GHCR with
latest(and optionally${{ github.sha }}).
- Logs into GHCR using
Test job requirements
Create a workflow .github/workflows/ansible-site-test.yml that:
-
Triggers on:
-
workflow_dispatch -
pull_requestandpushthat touch:ansible/**site.yml.github/workflows/ansible-site-test.yml
-
-
Has two jobs:
-
build-ansible-base-image- Runs on
ubuntu-latest. - Builds and pushes the GHCR image described above.
- Uses
GITHUB_TOKENfordocker login.
- Runs on
-
ansible-site-test-
needs: build-ansible-base-image. -
runs-on: ubuntu-latest. -
Uses the GHCR image as the job container:
container.image: ghcr.io/<org>/<repo>/fedora-ansible-43-ansible:latest
-
Steps:
-
Checkout the repo (
actions/checkout). -
cd ansibleand run:ansible-playbook site.yml
-
-
Fail the job if
ansible-playbookexits non-zero.
-
Acceptance criteria
-
Running the workflow on
workflow_dispatch:- Builds and pushes the Fedora 43 Ansible base image to GHCR.
- Starts the
ansible-site-testjob using that image. - Successfully runs
ansible-playbook site.ymlfrom theansibledirectory.
-
Subsequent runs reuse the GHCR image without needing code changes.