Ansible- Docker Integration
What is Ansible?
Ansible is an opensource automation tool used for configuration management and application deployment. It is used for configuring and deploying packages at a system remotely with the use of SSH and SCP protocols.
Ansible is an intelligent tool that uses RAL (Resource Abstraction Layer) to use a common set of commands to deploy packages and actions in various OS without having to tell the exact commands or the OS. Ansible gets this intelligence from modules which enable it to do so.
What are playbooks?
Playbooks are a set of commands written together in a programming file using the YML language and is used to deploy any action using Ansible. It also uses integrations of Jinja to define variables in the script.
- RedHat Linux 8 (RHEL 8)
- Yum repository setup and configuration
- Epel repository setup and configuration
- Ansible downloaded
- Web page created as home.html
Ansible can also be used to set up docker and deploy an Apache web server through it. The following playbook demonstrate the action.
- hosts: all
description: docker yum installation
All the plays being performed in about a minute.
Now we may go to the managed node OS and find the web server perfectly hosted by using a Centos:7 inside a docker container. This web page may be visited through any browser connected to the same network using the IP address and the port number.
The above project has been made on RHEL 8.