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. It includes its own declarative language to describe system configuration.
Playbooks are Ansible’s configuration, deployment, and orchestration language. They can describe a policy you want your remote systems to enforce or a set of steps in a general IT process. If Ansible modules are the tools in your workshop, playbooks are your instruction manuals, and your inventory of hosts is your raw material. At a basic level, playbooks can be used to manage configurations of and deployments to remote machines.
The Apache HTTP Server, colloquially called Apache, is a free and open-source cross-platform web server software, released under the terms of Apache License 2.0. Apache is developed and maintained by an open community of developers under the auspices of the Apache Software Foundation.
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 webserver.
- Write the IP of the Managed Node in the Ansible Inventory.
- Create a playbook file.
- Write a task to create a Docker Repository
4. Write a task to install Docker
5. Write a task to create a directory on Managed Node
6. Write tasks to copy the web content and start the Docker Services
7. Write tasks to pull “httpd” web server image and launch the container
Now, Run the Ansible Playbook
Start the Managed Node and check if everything is configured properly or not
Final Web Page
GitHub Link: https://github.com/manan-bedi2908/Ansible-Apache
Thank you for reading