Configure Apache Webserver on top of Docker Container with help of Ansible Playbook

OBJECTIVE:

  1. Configure Docker.

PREREQUISIT

  1. Should have 2 linux os yum configured.

Starting with Downloading Docker

Firstly we will configure yum repository for docker in target node for downloading docker and then we will Install docker and will start docker service

We can see docker service is running in our Target Node

Now we will install pip3 command or can say python3 to download docker software development kit (sdk) for integrating docker with ansible

With help of ansible we now download httpd server image from docker hub and will copy content for website in /var/www/html file.

Now we will check in target node that our file index.html is present there or not.

Now we have to expose our container so everybody can see our website

Now if we try to connect with container IP and we see the web page i.e index.html with Output HTTP server on docker which we have written in index.html.

This is final playbook for our entire setup

THANK YOU

HAPPY CODING