Make Targets and Variables¶
The Makefile orchestrates build, test, and publish tasks.
Targets¶
setup— NEW: Verify development environment setup and provide installation guidance.- Checks for required system packages (
podman,python3,git,jq,envsubst) - Validates Python version (requires 3.10+ for
ansible-navigator) - Detects and recommends Python 3.11/3.12 if available
- Checks for Ansible Automation Platform tools (
ansible-builder,ansible-navigator,ansible-core) - Provides RHEL-specific RPM installation instructions when applicable
- Insight: Run this first before building to catch environment issues early
clean— remove build artifacts and prune images.lint— run yamllint.token— renderansible.cfgfrom template and pre-fetch collections (validatesANSIBLE_HUB_TOKEN).build— build the EE viaansible-builder.- Note: Requires
ANSIBLE_HUB_TOKENenvironment variable for certified collections - Note: Requires login to
registry.redhat.ioto pull base image inspect—podman inspectthe built image.list— list the built image (podman images --filter reference=...).info— show layers, Ansible version, collections, pip packages, rpm list.test— runfiles/playbook.ymlviaansible-navigatorusing the built image.- Note: Uses
--pull-policy neverto use locally built images, preventing registry connection errors - Note: Does not require
ANSIBLE_HUB_TOKEN(token only needed for build) publish— tag and push toTARGET_HUB.shell— open a shell in the image.docs-setup/docs-build/docs-serve/docs-test— local docs workflows.setup-openshift-tarball— setup Path B (tarball) configuration.build-openshift-tarball— build with Path B (tarball install).test-openshift-tarball— build and test Path B.setup-openshift-rhsm— setup Path A (RHSM) configuration.build-openshift-rhsm— build with Path A (RHSM/RPM install).test-openshift-rhsm— build and test Path A.test-openshift-tooling— test OpenShift/Kubernetes tooling in built image.
Variables¶
TARGET_NAME— image name (default:ansible-ee-minimal).TARGET_TAG— image tag (default:v5).CONTAINER_ENGINE— container runtime (default:podman).VERBOSITY— ansible-builder verbosity level (default:3).TARGET_HUB— registry forpublish(default:quay.io).
Environment requirements:
- ANSIBLE_HUB_TOKEN — required for build and token targets; used to access Automation Hub/validated content.
- Insight: Token check is performed at execution time, not parse time. This allows targets like test, setup, lint to run without requiring the token.
- Note: The token is only needed when building images that include certified collections from Red Hat Automation Hub.
Common Invocations¶
# First-time setup: Verify environment
make setup
# Clean rebuild
make clean build
# Build with explicit container engine and tag
CONTAINER_ENGINE=podman TARGET_TAG=v5 make build
# Build then test (test doesn't require ANSIBLE_HUB_TOKEN)
make build test
# Test without building (if image already exists)
make test
# Publish to quay.io/your-namespace
TARGET_HUB=quay.io TARGET_NAME=your-namespace/ansible-ee make publish
Key Insights¶
Token Requirements¶
- Build and token targets require
ANSIBLE_HUB_TOKEN— These targets need to authenticate with Red Hat Automation Hub. - Test, setup, lint targets don't require token — These can run independently without authentication.
- GitHub Actions workflows: Set
ANSIBLE_HUB_TOKENas a secret and pass it viaenv:for build steps only.
Image Pull Policy¶
- The
testtarget uses--pull-policy neverto ensure it uses locally built images. - This prevents errors when
ansible-navigatortries to pull from a registry that doesn't have your image. - Insight: Always test locally built images before pushing to registries.
Python Version Requirements¶
ansible-navigatorrequires Python 3.10 or later.- On RHEL 9, Python 3.9 is the default, but Python 3.11 is available via
python3.11package. - Recommendation: Install Python 3.11+ for best compatibility:
sudo dnf install -y python3.11 python3.11-pip - The
setuptarget detects and recommends the appropriate Python version.
System Dependencies¶
- The minimal base image (
ee-minimal-rhel9) doesn't includepython3-pipby default. - Required: Add
python3-piptofiles/bindep.txtfor pip to be available during builds. - See Troubleshoot EE Builds for the "No module named pip" error solution.
Optional Config Flows¶
OpenShift/Kubernetes Tooling¶
The project supports two paths for installing OpenShift/Kubernetes tooling, tested separately to avoid conflicts:
Path A — RHSM/RPM install (requires RHSM entitlements):
# Create files/optional-configs/rhsm-activation.env with RH_ORG and RH_ACT_KEY
make setup-openshift-rhsm build-openshift-rhsm
# Or test it all at once:
make test-openshift-rhsm
Path B — Tarball install (no RHSM required):
# Automatically creates files/optional-configs/oc-install.env
make setup-openshift-tarball build-openshift-tarball
# Or test it all at once:
make test-openshift-tarball
Test existing image:
make test-openshift-tooling
See the Enable Kubernetes and OpenShift Tooling guide for details on the two-phase testing approach.