Rishabh
2 min readJan 7, 2021

🔰How to Write an Ansible Play-Book To:
🔹 Configure Docker
🔹Setting up a Webserver

We will be using minimalistic knowledge to achieve the task……
Now let’ s jump right into it 🔓

STEP1: Creating a playbook

>> vim docker.yml

STEP2: Installing docker on system

>>Using Yum repository to install Docker-ce(Community ed.)
>> Install package using ansible

STEP3: Installing other Requirements

>> Installing docker-py
>>Starting the docker service

STEP3: Pulling the httpd image from docker Hub

>>Pulling the Image having webserver installed
>>Running the container of the image downloaded

STEP4: Attaching docker port and volume (created) to Base OS

>>When starting container telling the base OS to refer the volume and port to run the webserver

STEP5: Creating the html code

>> writing the code to test our webpage

STEP6: Gathering IP to access the webpage

>> We need IP and port to go to our webpage

Hope this helps you…thanks for reading.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Rishabh
Rishabh

Written by Rishabh

Student from B.tech 2nd Year, A proud ARTH learner, love new technologies, Curious about many thing, likes to explore places, love eating pizza and much more.

No responses yet

Write a response