### Verify Development Environment Setup Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Checks for required tools and Python versions for building the execution environment. It provides installation instructions if prerequisites are missing. ```bash # This will check for required tools and provide installation instructions if needed make setup ``` -------------------------------- ### Clone Repository and Navigate Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Clones the Ansible Execution Environment repository and changes the current directory to the cloned repository. This is the initial step to get the project files. ```bash git clone https://github.com/tosin2013/ansible-execution-environment.git cd ansible-execution-environment ``` -------------------------------- ### Verify Ansible Execution Environment Setup (Bash) Source: https://context7.com/tosin2013/ansible-execution-environment/llms.txt Checks system setup and dependencies required for building the Ansible Execution Environment. The 'make setup' command verifies the OS, installed system packages, Python version, Ansible Automation Platform tools, podman, ansible-builder, ansible-navigator, and the ANSIBLE_HUB_TOKEN. ```bash # Check system setup and display installation instructions make setup # Output shows: # ✓ OS: rhel 9.3 # ✓ All required system packages are installed # ✓ Python 3.11 (meets requirement: 3.10+) # ✓ All required Ansible Automation Platform tools are installed # ✓ podman: podman version 4.9.4 # ✓ ansible-builder: 3.0.0 # ✓ ansible-navigator: 24.2.0 # ✓ ANSIBLE_HUB_TOKEN is set ``` -------------------------------- ### Test Execution Environment Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Runs a test playbook using `ansible-navigator` within the newly built execution environment to confirm its functionality. ```bash make test ``` -------------------------------- ### Start Interactive Shell Session in Ansible Execution Environment Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/README.md These commands demonstrate how to start an interactive shell session inside a specified Ansible execution environment container image using podman. They include options for basic access, mounting the current directory, and handling SELinux. ```shell # Generic command podman run -it registry.redhat.io/ansible-automation-platform-25/ee-minimal-rhel9:latest /bin/bash ``` ```shell # With volume mounts podman run -it -v $PWD:/opt/ansible registry.redhat.io/ansible-automation-platform-25/ee-minimal-rhel9:latest /bin/bash ``` ```shell # With volume mounts from SELinux enabled system podman run -it -v $PWD:/opt/ansible:z registry.redhat.io/ansible-automation-platform-25/ee-minimal-rhel9:latest /bin/bash ``` -------------------------------- ### Manual Setup, Build, and Test for Tarball Installation Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/enable-kubernetes-openshift.md Provides manual steps to set up, build, and test the tarball installation of OpenShift tooling (Path B). This allows for granular control over the process and is an alternative to the `make test-openshift-tarball` command. ```bash # Setup Path B configuration make setup-openshift-tarball # Build make build-openshift-tarball # Test make test-openshift-tooling ``` -------------------------------- ### Python Package Installation Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/README.md This command shows how to install Python packages listed in a `requirements.txt` file using `pip3`. This is a standard method for managing Python dependencies within a project or execution environment. ```shell pip3 install -r requirements.txt ``` -------------------------------- ### Enable Kubernetes/OpenShift Tooling (Recommended) Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Steps to enable Kubernetes and OpenShift collections and CLIs without RHSM. This involves creating an environment file, uncommenting collections, and rebuilding the image. ```bash # 1) Create files/optional-configs/oc-install.env with OC_VERSION=stable-4.19 (or a pinned version like v4.19.6). # 2) Uncomment kubernetes.core in files/requirements.yml. # 3) Rebuild: make build # 4) Verify: podman run --rm ansible-ee-minimal:v5 oc version --client ``` -------------------------------- ### Include System-Level Dependencies Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Specifies system-level packages needed for the execution environment, often for Python packages that require compilation. These are defined in `files/bindep.txt`. ```text dnf [platform:rpm] git [platform:rpm] # Uncomment the following for Kerberos support with Windows automation # krb5-libs [platform:rpm] # krb5-workstation [platform:rpm] ``` -------------------------------- ### Podman Commands for Image Management and Testing Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/README.md This section demonstrates using Podman for interacting with container registries and managing execution environment images. It includes logging into a registry, searching for images, running an image interactively with volume mounts, and installing dependencies. ```shell podman login registry.redhat.io podman search registry.redhat.io/ansible-automation-platform-25 podman run -it -v $PWD:/opt/ansible registry.redhat.io/ansible-automation-platform-25/ee-minimal-rhel9:latest /bin/bash ``` -------------------------------- ### Build Execution Environment Image Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Builds the custom execution environment image using `ansible-builder` via a Makefile target. It requires the `ANSIBLE_HUB_TOKEN` to be set. ```bash export ANSIBLE_HUB_TOKEN=$(cat token) make token # optional prefetch/validation of Galaxy/Hub access make build # Validate the image exists locally podman images --filter reference=ansible-ee-minimal:v5 ``` -------------------------------- ### Enable Kubernetes/OpenShift Tooling (RHSM) Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Steps to enable Kubernetes and OpenShift collections and CLIs using RHSM. This requires creating an activation environment file and uncommenting relevant collections before rebuilding. ```bash # 1) Create files/optional-configs/rhsm-activation.env with RH_ORG and RH_ACT_KEY. # 2) Uncomment kubernetes.core (and optionally redhat.openshift). # 3) Rebuild: make build ``` -------------------------------- ### Configure Base Image Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Defines the base container image for the execution environment. The `execution-environment.yml` file specifies the `base_image`. ```yaml images: base_image: name: 'registry.redhat.io/ansible-automation-platform-25/ee-minimal-rhel9:latest' ``` -------------------------------- ### Install MkDocs Dependencies Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/build-docs-locally.md Creates a virtual environment and installs the required Python dependencies for MkDocs from a requirements file. Ensure Python 3.9+ and pip are installed. ```bash python3 -m venv .venv source .venv/bin/activate pip install -r mkdocs.yml/requirements.txt ``` -------------------------------- ### Ansible Galaxy and Microdnf Dependency Management Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/README.md These commands illustrate how to manage Ansible collections and system dependencies using `ansible-galaxy` and `microdnf`. It covers installing collections from requirements, checking for specific files, upgrading collections, and installing necessary packages for Python development. ```shell ansible-galaxy collection install -r requirements.yml ansible-galaxy collection install --upgrade -r requirements.yml microdnf install krb5-libs krb5-workstation krb5-devel microdnf install vi git rsync unzip tar sudo gcc openssl openssl-devel gcc-c++ dnf libpq-devel python38-devel glibc-headers libcurl-devel libssh-devel jq python3-Cython python3-devel openldap-devel microdnf install vi git rsync unzip tar sudo gcc openssl openssl-devel gcc-c++ dnf libpq-devel python39-devel glibc-headers libcurl-devel libssh-devel jq python3-Cython python3-devel openldap-devel ``` -------------------------------- ### Add Python Packages Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Adds Python packages required by Ansible collections or playbooks to the execution environment. Dependencies are listed in `files/requirements.txt`. ```text # For reporting ara # Uncomment the following for Windows automation # pywinrm>=0.3.0 ``` -------------------------------- ### Makefile Targets for Ansible Execution Environment Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/README.md This snippet outlines common Makefile targets for managing the lifecycle of an Ansible Execution Environment. It covers setup, cleanup, dependency testing, building, testing, inspecting, and publishing the EE. Note that 'build' and 'token' targets require an ANSIBLE_HUB_TOKEN environment variable. ```makefile make setup make clean make token make build make test make inspect make info make shell make publish ``` -------------------------------- ### Customize Ansible Collections Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/tutorials/getting-started.md Specifies Ansible Collections to be included in the execution environment by editing the `files/requirements.yml` file. This allows for tailoring the environment to specific automation needs. ```yaml collections: - name: amazon.aws # For AWS automation - name: azure.azcollection # For Azure automation - name: community.general # A general collection of modules # - name: community.windows # Uncomment for Windows automation ``` -------------------------------- ### Add Python Pip to EE Dependencies Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/build-locally.md This example shows how to resolve a 'No module named pip' error during EE builds by adding `python3-pip` to the `files/bindep.txt` file. This ensures that pip is installed within the minimal base image, enabling the installation of Python packages required by Ansible collections or roles. ```text python3-pip [platform:rpm] ``` -------------------------------- ### Setting Up Build Environment with Make Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/troubleshoot-ee-builds.md Commands for setting up the local environment for building Execution Environments. This includes verifying the environment and installing necessary tools like specific Python versions on RHEL 9. ```bash make setup sudo dnf install -y python3.11 python3.11-pip ``` -------------------------------- ### Ansible Execution Environment Verification Checklist (Text) Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/reference/execution-environment-yaml.md A checklist to verify the successful setup and functionality of an Ansible execution environment. It includes checks for linting, token pre-fetching, build success with `podman` and `ansible-builder`, playbook execution, and Kubernetes/OpenShift collection verification. ```text Verification Checklist: - `make lint` passes and YAML formatting is correct. - `make token` confirms `ANSIBLE_HUB_TOKEN` and pre-fetches collections. - `make build` succeeds with `podman` and `ansible-builder`. - `make test` runs `files/playbook.yml` successfully via `ansible-navigator`. - If K8s/OpenShift collections are enabled: `oc version --client` works and `kubernetes.core` is listed in `ansible-navigator collections`. ``` -------------------------------- ### Install OpenShift/Kubernetes via RHSM/RPM Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/reference/make-targets.md Installs OpenShift/Kubernetes tooling using the Red Hat Subscription Manager (RHSM) and RPM packages. This method requires valid RHSM entitlements. It involves setting up an environment file with activation credentials and then building the tooling. A single command is available to execute the entire setup and testing process. ```bash # 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 ``` -------------------------------- ### GitHub Actions: Build and Push EE with Podman Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/ci-cd.md Automates the build, test, and publish process for an Ansible Execution Environment using Podman within GitHub Actions. It requires specific secrets to be set up in the GitHub repository for registry authentication. The workflow installs necessary tools, logs into registries, and executes 'make' commands for building and publishing. ```yaml name: Build and Push EE on: push: branches: [ main ] workflow_dispatch: jobs: build-and-push: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install dependencies run: | python -m pip install --upgrade pip pip install ansible-builder ansible-navigator # Install Podman if not available sudo apt-get update && sudo apt-get install -y podman - name: Login to registries env: QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }} QUAY_PASSWORD: ${{ secrets.QUAY_PASSWORD }} REDHAT_REGISTRY_USERNAME: ${{ secrets.REDHAT_REGISTRY_USERNAME }} REDHAT_REGISTRY_PASSWORD: ${{ secrets.REDHAT_REGISTRY_PASSWORD }} run: | echo "$QUAY_PASSWORD" | podman login -u "$QUAY_USERNAME" --password-stdin quay.io if [ -n "$REDHAT_REGISTRY_USERNAME" ] && [ -n "$REDHAT_REGISTRY_PASSWORD" ]; then echo "$REDHAT_REGISTRY_PASSWORD" | podman login -u "$REDHAT_REGISTRY_USERNAME" --password-stdin registry.redhat.io fi - name: Build, Test, and Publish EE env: TARGET_NAME: yourorg/ansible-ee-minimal # Replace with your target name TARGET_TAG: latest # Replace with your target tag CONTAINER_ENGINE: podman run: | make build TARGET_NAME=${TARGET_NAME} TARGET_TAG=${TARGET_TAG} CONTAINER_ENGINE=${CONTAINER_ENGINE} make test TARGET_NAME=${TARGET_NAME} TARGET_TAG=${TARGET_TAG} CONTAINER_ENGINE=${CONTAINER_ENGINE} make publish TARGET_NAME=${TARGET_NAME} TARGET_TAG=${TARGET_TAG} CONTAINER_ENGINE=${CONTAINER_ENGINE} ``` -------------------------------- ### Customize Build: Install Azure CLI in Ansible EE Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/explanation/concepts.md Example of customizing the Ansible Execution Environment build process by adding system-level dependencies. This snippet shows how to install the Azure CLI using `dnf` within the `prepend_base` stage of the build, ensuring it's available in the final container image. It requires uncommenting and potentially adapting the `execution-environment.yml` configuration. ```yaml additional_build_steps: prepend_base: # ... other commands - > RUN $PKGMGR install -y dnf && rpm --import https://packages.microsoft.com/keys/microsoft.asc && dnf -y install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm && $PKGMGR -y install azure-cli ``` -------------------------------- ### Install OpenShift/Kubernetes Tools via Tarball (Bash) Source: https://context7.com/tosin2013/ansible-execution-environment/llms.txt Installs oc and kubectl CLI tools into the execution environment using tarball downloads, bypassing RHSM subscriptions. This involves setting up configuration, potentially customizing versions or URLs in 'files/optional-configs/oc-install.env', and then running 'make build-openshift-tarball' and 'make test-openshift-tarball' to build and verify the installation. ```bash # Setup configuration for tarball installation make setup-openshift-tarball # Creates files/optional-configs/oc-install.env with: # OC_VERSION=latest-4.19 # Or customize the version/URL: cat > files/optional-configs/oc-install.env < ubi.repo < files/optional-configs/rhsm-activation.env < --syntax-check --mode stdout ``` -------------------------------- ### Common Makefile Invocations (Bash) Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/reference/make-targets.md Demonstrates typical commands for setting up, cleaning, building, testing, and publishing Ansible execution environments using make. These examples show how to set environment variables like CONTAINER_ENGINE, TARGET_TAG, and TARGET_HUB to customize build and publish actions. ```bash # 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 ``` -------------------------------- ### Serve MkDocs Site Locally Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/build-docs-locally.md Serves the built MkDocs site locally on the specified address and port (127.0.0.1:8000). This allows for live previewing during development. ```bash mkdocs serve -f mkdocs.yml/mkdocs.yml -a 127.0.0.1:8000 ``` -------------------------------- ### Verify Environment and Build EE with Makefile Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/build-locally.md This snippet outlines essential Makefile targets for setting up the environment, linting, fetching collections, building the Execution Environment (EE) image, validating the image tag, and running tests within the built image. It's crucial for local development and testing workflows. ```bash # From the repo root make setup # Verify environment setup (NEW - recommended first step) make lint # yamllint checks make token # verifies ANSIBLE_HUB_TOKEN and pre-fetches collections make build # builds the EE image via ansible-builder make list # validate the image tag exists locally make test # runs files/playbook.yml inside the built image ``` -------------------------------- ### Set Default Build Arguments Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/reference/execution-environment-yaml.md Configures default build-time arguments passed to the underlying containerfile during the build process. This example sets default options for `ansible-galaxy collection install`, such as ignoring SSL certificates. ```yaml build_arg_defaults: ANSIBLE_GALAXY_CLI_COLLECTION_OPTS: '--ignore-certs' ``` -------------------------------- ### Build MkDocs Site Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/build-docs-locally.md Builds the static MkDocs site using the configuration file located at mkdocs.yml/mkdocs.yml. The output will be placed in the 'site/' directory. ```bash mkdocs build -f mkdocs.yml/mkdocs.yml ``` -------------------------------- ### Test MkDocs Local Server Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/build-docs-locally.md A shell script to automate the process of building and serving the MkDocs site locally, then verifying its responsiveness. This is useful for quick testing. ```shell #!/bin/bash # Build the site mkdocs build -f mkdocs.yml/mkdocs.yml # Serve the site in the background python -m http.server 8000 --directory site/ & SERVER_PID=$! # Wait a moment for the server to start sleep 2 # Verify the site responds HTTP_STATUS=$(curl -s -o /dev/null -w "%{{http_code}}" http://127.0.0.1:8000/) if [ "$HTTP_STATUS" = "200" ]; then echo "MkDocs site is serving correctly." else echo "Error: MkDocs site did not respond with 200 OK (Status: $HTTP_STATUS)." kill $SERVER_PID exit 1 fi # Stop the server kill $SERVER_PID exit 0 ``` -------------------------------- ### Inspect and Debug EE Image with Makefile Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/build-locally.md Provides Makefile commands for inspecting the build details and contents of the Execution Environment (EE) image. `make info` offers a summary of layers, versions, and packages, while `make inspect` retrieves detailed container metadata. `make shell` allows interactive access inside the image for manual debugging. ```bash make info # layers, versions, packages summary make inspect # container metadata via podman/inspect make shell # open a shell inside the image for manual checks ``` -------------------------------- ### Manually Inspect EE Container with podman Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/testing-execution-environment.md Starts an interactive shell session inside the Execution Environment container using `podman run`. This allows for in-depth manual inspection of installed packages, Ansible collection locations, and running custom commands or scripts to test dependencies. ```bash # Replace with your image name and tag podman run -it -v $PWD:/opt/ansible /bin/bash ``` -------------------------------- ### Test Tarball Installation Path for OpenShift Tooling Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/enable-kubernetes-openshift.md Initiates the build and testing process specifically for the tarball installation method (Path B) of OpenShift tooling. This ensures the portable installation works correctly without requiring RHSM. ```bash # Build and test Path B export ANSIBLE_HUB_TOKEN=$(cat token) make test-openshift-tarball ``` -------------------------------- ### Build and Test Ansible EE with Make Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/AGENTS.md This snippet demonstrates the basic development workflow for building and testing an Ansible Execution Environment using Make targets. It ensures a clean build and validates the environment with a playbook. ```bash export ANSIBLE_HUB_TOKEN=your-token-here make clean make build make test ``` -------------------------------- ### Test RPM Installation Path for OpenShift Tooling Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/enable-kubernetes-openshift.md Initiates the build and testing process for the RPM installation method (Path A) of OpenShift tooling, which requires RHSM credentials. This phase ensures that the installation via Red Hat repositories functions as expected. ```bash # First, create files/optional-configs/rhsm-activation.env with: # RH_ORG= # RH_ACT_KEY= ``` -------------------------------- ### Define System Package Dependencies (TXT) Source: https://context7.com/tosin2013/ansible-execution-environment/llms.txt Specifies system packages needed within the execution environment, targeting RPM-based platforms. This file, typically 'files/bindep.txt', lists packages like 'git', 'jq', 'rsync', and development tools like 'python3-pip', 'libcurl-devel', and 'openssl-devel'. ```txt # files/bindep.txt - System packages dnf [platform:rpm] git [platform:rpm] jq [platform:rpm] rsync [platform:rpm] python3-pip [platform:rpm] libcurl-devel [platform:rpm] openssl-devel [platform:rpm] ``` -------------------------------- ### Configure Tarball Version for OpenShift Client Installation Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/enable-kubernetes-openshift.md Specifies the version of the OpenShift client to be downloaded and installed from a tarball. This configuration is used in Path B, which does not require RHSM entitlements and allows for a more portable build. ```shell # Tracks latest in the 4.19 stream; or pin to an exact tag like v4.19.6 OC_VERSION=stable-4.19 ``` -------------------------------- ### Addressing curl vs curl-minimal Conflict Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/troubleshoot-ee-builds.md A workaround for conflicts reported by microdnf when installing curl. The fix involves attempting to install `curl` and `tar` or prioritizing `curl-minimal` if a conflict arises, allowing the build to proceed. ```bash ($PKGMGR -y install curl tar || true) ``` -------------------------------- ### Add System-Level Kerberos Dependencies Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/add-windows-support.md This snippet includes the necessary Kerberos system packages (`krb5-libs`, `krb5-workstation`, `krb5-devel`) in `bindep.txt` for secure authentication with Windows hosts, particularly when using domain authentication. ```text # (Optional) Windows Authentication - Kerberos # https://docs.ansible.com/automation-controller/latest/html/administration/kerberos_auth.html krb5-libs [platform:rpm] krb5-workstation [platform:rpm] krb5-devel [platform:rpm] ``` -------------------------------- ### Customize Ansible Execution Environment Build Steps Source: https://context7.com/tosin2013/ansible-execution-environment/llms.txt Allows adding custom installation steps to the execution environment build process using the `additional_build_steps` section in `execution-environment.yml`. It supports prepending or appending steps, such as installing packages or cleaning caches. ```yaml # execution-environment.yml - additional_build_steps section additional_build_steps: prepend_base: - RUN whoami - RUN cat /etc/os-release - RUN $PYCMD -m pip install --upgrade pip prepend_galaxy: - COPY _build/configs/ansible.cfg /etc/ansible/ansible.cfg append_final: - RUN pip3 check - > RUN $PKGMGR clean all && rm -rf /var/cache/{dnf,yum} && rm -rf /var/log/* ``` ```bash # Example: Add Azure CLI to execution environment # Edit execution-environment.yml and uncomment: # - > # RUN $PKGMGR install -y dnf && # rpm --import https://packages.microsoft.com/keys/microsoft.asc && # dnf -y install -y https://packages.microsoft.com/config/rhel/9.0/packages-microsoft-prod.rpm && # $PKGMGR -y install azure-cli # Then rebuild make build ``` -------------------------------- ### Define Python Dependencies (TXT) Source: https://context7.com/tosin2013/ansible-execution-environment/llms.txt Lists Python packages and their versions required for the execution environment. This file, typically 'files/requirements.txt', includes essential packages like pip and setuptools, along with optional ones like 'ara' and commented-out entries for specific use cases like Windows automation. ```txt # files/requirements.txt - Python dependencies pip>=21.0 setuptools>=50.0 ara # pywinrm>=0.3.0 # Uncomment for Windows automation ``` -------------------------------- ### Validate Token and Download Certified Collections Source: https://context7.com/tosin2013/ansible-execution-environment/llms.txt Tests the Red Hat Automation Hub token and downloads certified Ansible collections. It creates an `ansible.cfg` with the token, sets up a collections directory, downloads requirements from `files/requirements.yml`, and validates authentication. ```bash # Verify token and download collections make token # Process: # 1. Creates ansible.cfg with ANSIBLE_HUB_TOKEN # 2. Creates collections/ directory # 3. Downloads collections from files/requirements.yml # 4. Validates authentication to console.redhat.com # Output: # Starting galaxy collection download process # [WARNING]: Collection ansible.hub:1.1.0 already exists, skipping # Downloaded collection ansible.controller:4.6.1 # Downloaded collection amazon.aws:7.6.0 ``` -------------------------------- ### Install OpenShift/Kubernetes via Tarball Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/reference/make-targets.md Installs OpenShift/Kubernetes tooling using a tarball, which does not require RHSM entitlements. This method automatically generates the necessary environment configuration file. Commands are provided for setting up, building the tooling, and a consolidated command to run all tests. ```bash # 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 ``` -------------------------------- ### Install Python 3.11 on RHEL 9 Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/docs/how-to/build-locally.md This command installs Python 3.11 and its corresponding pip package on a Red Hat Enterprise Linux 9 system. This is often necessary when `ansible-navigator` requires a newer Python version than what is available by default, ensuring compatibility for Execution Environment builds and runs. ```bash sudo dnf install -y python3.11 python3.11-pip ``` -------------------------------- ### Podman-Specific Ansible EE Build and Test Source: https://github.com/tosin2013/ansible-execution-environment/blob/main/AGENTS.md This snippet shows how to execute the Ansible Execution Environment build and test process specifically using Podman as the container engine. It also allows for custom image tagging. ```bash CONTAINER_ENGINE=podman TARGET_TAG=v5 make clean build test ```