AnsiblePilot — Master Ansible Automation

AnsiblePilot is the leading resource for learning Ansible automation, DevOps, and infrastructure as code. Browse over 1,100 tutorials covering Ansible modules, playbooks, roles, collections, and real-world examples. Whether you are a beginner or an experienced engineer, our step-by-step guides help you automate Linux, Windows, cloud, containers, and network infrastructure.

Popular Topics

About Luca Berton

Luca Berton is an Ansible automation expert, author of "Ansible for VMware by Examples" and "Ansible for Kubernetes by Example" published by Apress, and creator of the Ansible Pilot YouTube channel. He shares practical automation knowledge through tutorials, books, and video courses to help IT professionals and DevOps engineers master infrastructure automation.

Deploy Apache HTTPD Container with Podman via Ansible

By Luca Berton · Published 2024-01-01 · Category: installation

Automate the deployment of Apache HTTPD in a Podman container using Ansible. Set up web root, custom index.html, and manage container settings.

How to Setup Apache Web Server in a Podman Container for RedHat-like systems with Ansible? I'm going to show you a live Playbook with some simple Ansible code. I'm Luca Berton and welcome to today's episode of Ansible Pilot.

Setup Apache Web Server in a Podman Container for RedHat-like systems • install packages => ansible.builtin.yum • custom index.html => ansible.builtin.copy • pull image => containers.podman.podman_image • run container => containers.podman.podman_container

Today we’re talking about how to Deploy a web server apache httpd in a Podman Container for RedHat-like Linux systems. The full process requires four steps that you could automate with different Ansible modules. Firstly you need to verify that podman and it dependency is successfully installed on the target system using the ansible.builtin.yum Ansible module. Secondly, you need to create the custom index.html with ansible.builtin.copy Ansible module. You could upgrade this step using the template module. Thirdly, you need to pull the image for the container hub registry using the containers.podman.podman_image Ansible module. Finally, you could run the webserver container setting the right port and settings using the containers.podman.podman_container Ansible module.

Linkscontainers.podman.podman_imagecontainers.podman.podman_containerhttpd image

## Playbook

How to Setup Apache Web Server in a Podman Container for RedHat-like systems with Ansible Playbook.

code

execution

idempotency

before execution

after execution

!Apache Web Server in a Docker Container for RedHat-like systems

code with ❤️ in GitHub

Conclusion

Now you know how to set up Apache Web Server in a Podman Container for RedHat-like systems with Ansible.

Related ArticlesAnsible Template GuideAnsible Docker GuideAnsible Inventory GuideAnsible Become Guideansible.builtin.file Guide

Category: installation

Watch the video: Deploy Apache HTTPD Container with Podman via Ansible — Video Tutorial

Browse all Ansible tutorials · AnsiblePilot Home