Deploy Web Server on Docker through Ansible

Task Description :-

1. Configure Docker

2. Start and enable Docker services

3. Pull the httpd server image from the Docker Hub

4. Run the httpd container and expose it to the public

5. Copy the html code in /var/www/html directory and start the Web server

Step 1 : Configure Docker on Managed Node.

For installing the docker software first we need to configure and then we will use command module to install docker software.

After installing the docker software we start docker service on managed node.

Step 2 : Pull httpd image from Docker Hub and launch httpd container.

Step 3 : In this step we will run the playbook.

Now we can check the managed node.

Thank You !!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store