#arth python python3 vimaldaga righteducation educationredefine rightmentor worldrecordholder linuxworld makingindiafutureready righeudcation
Explore tagged Tumblr posts
Text
APACHE WEBSERVER CONFIGURATION IN DOCKER USING ANSIBLE ⚜

Now the question is what is docker and what is ansible ???
Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. With Docker, you can manage your infrastructure in the same ways you manage your applications.
Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs.
SO basically our task is :
🔰Write an Ansible PlayBook that does the following operations in the managed nodes: 🔹 Configure Docker 🔹 Start and enable Docker services 🔹 Pull the httpd server image from the Docker Hub 🔹 Run the docker container and expose it to the public 🔹 Copy the html code in /var/www/html directory and start the web server
Lets do it :))))
So lets know some of the concept of ansible first :
Ansible Playbooks :
Ordered lists of tasks, saved so you can run those tasks in that order repeatedly. Playbooks can include variables as well as tasks. Playbooks are written in YAML and are easy to read, write, share and understand.
♦️ Inventory :
A list of managed nodes. An inventory file is also sometimes called a “hostfile”. Your inventory can specify information like IP address for each managed node. An inventory can also organize managed nodes.
♦️ Control Node:
Any machine with Ansible installed is known as controller node. You can run Ansible commands and playbooks by invoking the ansible or ansible-playbook command from any control node. You can use any computer that has a Python installation as a control node - laptops, shared desktops, and servers can all run Ansible. However, you cannot use a Windows machine as a control node. You can have multiple control nodes.
If you want to install ansible use below commands :
pip3 install ansible
yum install sshpass
ansible --version >> TO check version
Lets do the project ::
So this is my managed nodes where we will use ansible book to automate docker using ansible :
so In this picture you can clearly see we dont have docker , HTTPD and hostname is Managed_node so Lets automate :
IP : 192.168.147.139
And this is my controller nodes from where we will automate the managed Node :
IP : 192.168.147.138
So Let do ::
If this shows its means you are ready to go :
Lets create yaml file and automate the managed Node :
Finally created the yml file :)
And now if we are trying to go to this url we will reach to our destination :) : http://192.168.147.139:32771/Search/index.html
So we come to the end of our task :
Thanku || hope you all enjoy my task |
Github link for this project : https://github.com/ROHITkumaw/Search_Capital
linkedln : https://www.linkedin.com/in/rohit-kumar-4b5183181/
1 note
·
View note