Ansible For Containers By Examples
Ansible Modules To Automate the Docker, Podman, Kubernetes and OpenShift containers


Automating your containers (Docker, Podman, Kubernetes and OpenShift) with Ansible enables you to achieve Infrastructure As Code (IaC). Using IaC you’re going to be able to automate your workflow, your CI/CD pipelines for example, and be faster about your critical business demands.
Beginners
Ansible provides various modules to manage Docker containers, Docker, Podman, etc. I’ll show you step by step how to prepare your Ansible controller to interact with the Docker engine. This initial configuration sometimes is a roadblock for some Docker users to start using Ansible.
- Deploy Apache Web Server in a Docker Container for Debian-like systems - Ansible modules docker_image and docker_container
- Deploy Apache Web Server in a Podman Container for RedHat-like systems - Ansible modules podman_image and podman_container
- Deploy Apache Web Server in a Podman Container for RedHat-like systems - Ansible modules podman_image and podman_container IMPROVED
Installation
AWX
- Install Ansible AWX Operator for Kubernetes (K8s) and OpenShift (OCP) - Ansible AWX
- Run the latest Ansible AWX in Docker containers
- Build Ansible AWX in Docker containers - ansible AWX
- Run and Stop Ansible AWX in Docker containers - Ansible AWX
- Create Ansible AWX superuser in Docker containers - Ansible AWX
Kubernetes
Create Kubernetes K8s or OpenShift OCP namespace project - Ansible module k8s
Create Kubernetes K8s or OpenShift OCP pod - Ansible module k8s
Create Kubernetes K8s or OpenShift OCP secret - Ansible module k8s
Create Kubernetes K8s or OpenShift OCP service - Ansible module k8s
Install Red Hat OpenShift Local Kubernetes in macOS on MacBook Pro Intel x86_64 and M1 arm64.md
Assign CPU Resources to Kubernetes K8s or OpenShift OCP Containers and Pods - Ansible module k8s
Assign Memory Resources to Kubernetes K8s or OpenShift OCP Containers and Pods - Ansible module k8s
Troubleshooting
The Best Resources Ansible For Containers (Docker, Podman, Kubernetes and OpenShift)
Video Course
eBook
Recap
Now you know how you could automate your Docker containers using Ansible Automation technology. Subscribe to the YouTube channel, Medium, Website, Twitter, and Substack to not miss the next episode of the Ansible Pilot.
Academy
Learn the Ansible automation technology with some real-life examples in my
My book Ansible By Examples: 200+ Automation Examples For Linux and Docker System Administrator and DevOps
Donate
Want to keep this project going? Please donate