Successfully completed Ansible task!
About Ansible:
Ansible is a radically simple IT automation engine that automates cloud provisioning, configuration management, application deployment, intra-service orchestration, and many other IT needs. Designed for multi-tier deployments since day one, Ansible models your IT infrastructure by describing how all of your systems inter-relate, rather than just managing one system at a time.
About Docker:
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers. Containers allow a developer to package up an application with all of the parts it needs, such as libraries and other dependencies, and deploy it as one package. By doing so, thanks to the container, the developer can rest assured that the application will run on any other Linux machine regardless of any customized settings that machine might have that could differ from the machine used for writing and testing the code.
In a way, Docker is a bit like a virtual machine. But unlike a virtual machine, rather than creating a whole virtual operating system, Docker allows applications to use the same Linux kernel as the system that they're running on and only requires applications be shipped with things not already running on the host computer. This gives a significant performance boost and reduces the size of the application.
I am currently learning "Automation using ansible" under the World record holder Mr. Vimal Daga and i am very great full to him for guiding us during this training.
About task:
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 httpd container and expose it to the public
🔹 Copy the html code in /var/www/html directory and start the web server
Solution:
- My Controlled node is redhat 8 system with IP 192.168.43.50 and it's inventory has an IP of my managed node.
2. Manged node is also a redhat8 system. It doesn't have docker installed in it. My task is to install docker in managed node by using ansible through controlled node.
3. Before installing the docker , i need to copy a .repo file to my managed node in order to install docker-ce. I have also done the same using ansible.
The docker image that i am going to pull contains apache webserver and also php.
4. The next step is to write ansible playbook to complete the task on remote system.
5. After running ansible-playbook command, docker is installed, configured and running on remote system. Ansible also is launching the container and storing webpages in it. Ip of container node is 160. When i run it on browser, i get the website.
Thank you very much Mr. Vimal Daga sir.
Congratulations 🎉🎉🎉🎉 Congratulations 🎉🎉🎉🎉 Congratulations 🎉🎉🎉🎉🎉🎉🎉 Prasad Sir 🔥🔥🔥🔥🔥 Keep going 🚶🚶🏃🏃🏃🏃🏃🏃
Great work prasad
Good job 👍
Great work.