Ansible | Docker | Dynamic inventory | apache
What is ansible?
Ansible is an open-source software provisioning, configuration management, and application-deployment tool enabling infrastructure as code. It runs on many Unix-like systems and can configure both Unix-like systems as well as Microsoft Windows.
What is Docker?
Docker is an application build and deployment tool. It is based on the idea that you can package your code with dependencies into a deployable unit called a container. Containers have been around for quite some time
What is Apache HTTP Server?
Apache HTTP Server is a free and open-source web server that delivers web content through the internet. It is commonly referred to as Apache and after development, it quickly became the most popular HTTP client on the web.
????Task Description??
?? 14.2 Further in ARTH - Task 10 has to create an ansible playbook that will retrieve new container IP and update the inventory. So that further Configuration of the Webserver could be done inside that Container.
Now, Let's begin
The inventory file is empty.
This task is performed on localHost And this my playbook 1 docker.yml
Steps in the first playbook docker.yml
Using the Ansible facts we retrieved the container IP and stored it
Now, Running the above playbook will launch a new container and dynamically input the IP into the inventory file inv.txt.
Container Name: happynewyear
Container IP: 172.17.0.2
Let's check if the inventory file is updated or not.
It's successfully updated.
Now further, let's configure the web server on that container.
- The second playbook fweb.yml
- After running the playbook.
Successfully configured the webserver on a docker container and dynamically stored the IP in the inventory file.
Thank You !!!??
Keep Learning !! Keep Sharing!!!??
DevOps @Forescout ?? | Google Developer Expert | AWS | DevOps | 3X GCP | 1X Azure | 1X Terraform | Ansible | Kubernetes | SRE | Platform | Jenkins | Tech Blogger ??
4 年Good going Suyog Shinde
ML | DL | DevOps | Linux | AWS | Python |
4 年????
Software Engineer
4 年Nice Suyog Shinde ?????
ARTH - School Of Technologies || Python || Amazon Web Service || Big Data || C || C ++ || DevOps (Kubernetes , Ansible , Docker , Git and GitHub , Jenkins )
4 年great Suyog Shinde