Configuring Apache Web Server on Docker Using Ansible

In this article, I will tell you how to configure and start web-server using ansible-playbook.

Task Description

First of all, we have to update the inventory with the IP of the managed node.

Update Inventory

Create Workspace

Create Playbook

Steps to create playbook:

Step 2: Insert the variables

Step 3: Task to Configure Yum to install docker

Step 4: Task to Install Docker

Step 5: Task to Install Python interpreter

Step 6: Task to Install the docker library

Step 7: Task to Start Docker Service

Step 8: Task to create a directory in the target node to mount on a container.

Step 9: Task to copy the file from the controller node to targeted node

Step 10: Task to Pull httpd server image from docker hub

Step 11: Task to Run docker container

Thank you for reading