All publications of Sakshi Jain . जयपुर , भारत
- Automation is the technology by which a process is performed with minimal human assistance in short period of time.
- Various Automation tools available -Puppet ,CHEF ,Ansible ,SALTSTACK,JUJU
NEED OF AUTOMATION:-
- Automation is key to IT optimization and digital transformation.
- Automation gives the administrator tools to effectively deploy scalable workloads & reducing the staff requirement to do so.
- DevOps requires paying down technical debt, such as time-sucking manual patches, so people can focus on more important problems.
- If in the organization there are some common requirements come on regular basis then we don't need to repeat the same steps again to do so we only write the code once and run every time. By which we can improve productivity.
- Ansible is an open-source tool, agentless, easy to learn & written in python language.
- Ansible is a declarative tool i.e. its modules are independent of OS.
- The modules & idempotence feature of ansible make it intelligent.
- Installation requirement of ansible is only at Controller Node.
- We need to give instructions to ansible what we want to do at MN and it will figure-out how to do that .That means we don't need to remember OS specific commands for Configuration.
- Ansible automates provisioning, configuration management, security automation , networking , application deployment, orchestration, integration, delivery task and many more.
- Ansible helps in removing SILOS and improve team work as multiple teams can work on same tool in organizations.
- In ansible we can give instructions in adhoc way or using playbook that is the list of tasks having modules and attributes.
- Ansible Tower is Ansible at an enterprise level having web-based user Interface that makes ansible more easy to use for IT teams . It is designed for all of the automation tasks.
- Tower is free for usage for up to 10 nodes and having amazing support from Ansible.
- Using Ansible Tower we can centralize and control IT infrastructure with a visual dashboard, role-based access control, job scheduling, integrated notifications and graphical inventory management.
- Ansible Tower can easily embed into existing tools and processes with REST API and CLI.
ANSIBLE TOWER REQUIREMENT :-
- In Ansible if our controller node goes down the complete automation process suffers and at that time the main requirement of Ansible Tower comes into play.
- Ansible Tower comes with clustering feature .
- we have multiple Ansible tower deployed and they share common database "PostgreSQL" and using we have redundancy to scale our automation even after controller node goes down
Ansible Tower Workflow:-
- Ansible Tower allow us to easily model complex processes so, that we can chain any number of playbooks, updates, and other workflows, regardless of whether they use different inventories, run at different users, run at once or utilize different credentials.
- We can build a provisioning workflow that provisions machines, applies a base system configuration, and deploys an application, all with different playbooks maintained by different teams.
- We can build a CI/CD testing workflow that builds an application, deploys it to a test environment, runs tests, and automatically promotes the application based on test results.
- We can Set up different playbooks to run in case of success or failure of a prior workflow playbook.
- A job template is a set of parameters for running an Ansible job. Job templates are useful to execute the same job many times.
- Job Templates tab allow user to launch, schedule, modify, and remove a job template.
- To set job template we go on the Job Templates page, click ADD button to add a Job Template. Give Name of the Job Template ,Select JOB TYPE, choose a PLAYBOOK and SAVE it and click the rocket ship icon to run the Job.
- Credentials are utilized by Tower for authentication when launching jobs.
- We grant users and teams the ability to use these credentials, without actually exposing the credential to the user.
- It includes fields like name, description , type, username, password ,private key, private key passphrase, privilege escalation, privilege escalation username ,privilege escalation password, vault password.
- In Credential type pre-created options like Microsoft Azure ,OpenStack, AWS ,Machine, Source Control etc. are available but we can add our customized ones also.
- In Ansible orchestration allows us to define infrastructure once and use it wherever and however .
- Once we write playbooks that describe multi-node production infrastructure we can use the same orchestration to deploy it on our laptop for testing.
USE CASES :-
1)ANSIBLE TOWER INTEGRATION WITH SLACK:-
- SLACK- A notification tool & CHATOPS - used for operation tooling , system administrators to let developers get notifications.
- In ansible tower there is an option of getting notifications where we can select where we want these notification on Gmail , slack or wherever. In this session we saw whenever we run any task its notification being sent on slack channel. so, that the team in have all the details what and when the things being done .
2)LAUNCHING AWS INSTANCE & RUNNING MULTIPLE PLAYBOOKS:-
- First we install an AWS instance using ansible tower using ec2 and then define workflow of various playbooks :- such as on successful launching deploy to prod and on its success get its info and on failure run GitOPS.