Self-Reflection of Industry use-case on Automation using Ansible
Deepak Sharma
3 x RedHat Certified Engineer (EX200, EX294, EX180) || DevOps Engineer || Docker || K8s || Ansible || Linux || Git || Github || Gitlab || Terraform || Jenkins || Cloud Computing || AWS
In this session , I learned that how ansible is used in the real world to automate the complex and bigger tasks in less time.
Automation :-
Automation is used to automate tasks or processes and reduce manual interaction. we can use automation in most of the fields such as deployment, integration, delivery task, development tasks, etc. Automation can help in providing infrastructure or configuration in less time and the complex tasks can be implemented in a faster way.
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. It includes its own declarative language to describe system configuration .
Ansible-Tower :-
Ansible tower is build on the top of ansible tool to hide the complexity and provide a GUI -based interface to automate the tasks very easily. Ansible Tower is the clusters of the controller node . Ansible tower is a Enterprise Ansible Solution built on top of Ansible Engine, whereas Ansible is also known as the Ansible Engine is the command-line tool. It provides us with an API, with Role-Based Access Control, along with scheduling features.
Use-Case :-
1. Scaling :-
Scaling is very much needed in current world because no-one knows at which point traffic will increase on your site so we have to create the playbooks in such a way so that they can scaled the infrastructure in very less time.
For example :- If I launch a website and after some my idea become viral and I got a lot of traffic on my website. Every server has some limit to provide the service to the user. But due to high traffic , my website goes down . No-user can like this kind of website and I lost my clients.
But on the other hand , If I use automation , then I can resolve this issue by scaling the server in very less time and split the traffic among them. So every user get a better service and I don't lost any my client.
2. To Achieve CI/CD :-
CI/CD means continuous integration and continuous development. We can integrate multiple small-small tasks and automate them using ansible- playbook.
For example:-I create the vpc and subnet on the top of aws cloud and after that launch ec2 instance. The configurations of this infrastructure can be done by using a single ansible-playbook . For this we provide credential authentication of AWS to ansible-tower, once the parameters are satisfied, we can able to launch the template and achieved the automation.
3. Workflow and Integration with Slack :-
Ansible Tower Workflow helps to allow us to run one playbook after another with success and fail scenario and we can also integrate Slack notifications in Ansible Tower using Slack Tokens and integrating them with Ansible Tower Workflows.
- We can also add approval for a template . So in this case , when any a template run successfully, then ask for approval and without approval , the next template could not run .
- We can also integrate ansible-tower with Slack . So we got status of template on slack weather it run successfully or failure.
4. Virtual Environment :-
Sometimes our requirement could not be fulfilled by the by default ansible tower . In this case , we can take help of Python virtual Environment to achieved it. For example , in ansible tower we do not see any option to create credential for the oracle cloud . But by the help of python virtual environment , we can resolve this issue.