ARTH - Task 11.2 ??????
Pratik Kohad ????
SIH Grand Finalist 2020 || MLops || ARTH Ambassador and Learner at LinuxWorld Informatics Pvt. Ltd
Task Description??
?? 11.2 Create an Article, blog, or Video on how industries are solving challenges using Ansible.
Hello, Connections !!!
This is an important article on Ansible and its Industrial use-cases. In this article, you will get to know about Ansible in detail.
Automation is the key to realizing the philosophy of DevOps and ensuring that it delivers. The underlying building blocks of DevOps are to ensure that the engineering platform is in place to facilitate continuous delivery, integration, and improvement.
The implementation of automation technologies, techniques and processes improve the efficiency, reliability, and/or speed of many tasks that were previously performed by humans.
Now let’s understand what actually is Ansible & how it is used…
What is Ansible???
In simple words, Ansible is an open-source IT automation engine, which can remove drudgery from your work life, and will also dramatically improve the scalability, consistency, and reliability of your IT environment. It is primarily intended for IT professionals, who use it for application deployment, updates on workstations and servers, cloud provisioning, configuration management, intra-service orchestration, and nearly anything a systems administrator does on a weekly or daily basis. Ansible doesn't depend on agent software and has no additional security infrastructure, so it's easy to deploy.
Because Ansible is all about automation, it requires instructions to accomplish each job. With everything written down in simple script form, it's easy to do version control. The practical result of this is a major contribution to the "infrastructure as code" movement in IT: the idea that the maintenance of the server and client infrastructure can and should be treated the same as software development, with repositories of self-documenting, proven, and executable solutions capable of running an organization regardless of staff changes.
While Ansible may be at the forefront of automation, systems administration, and DevOps, it's also useful to everyday users. Ansible allows you to configure not just one computer, but potentially a whole network of computers at once, and using it requires no programming skills. Instructions written for Ansible are human-readable. Whether you're entirely new to computers or an expert, Ansible files are easy to understand.
History of Ansible:
Here, are important landmarks from the history of ansible:
- In February 2012 the Ansible project began. It was first developed by Michael DeHaan, the creator of Cobbler and Func, Fedora Unified Network Controller.
- Initially called AnsibleWorks Inc, the company funding the ansible tool was acquired in 2015 by RedHat and later on, along with RedHat, moved under the umbrella of IBM.
- In the present, Ansible comes included in distributions like Fedora Linux, RHEL, Centos, and Oracle Linux.
Ansible’s Features:
- Configuration Management - The enterprise hardware and software information is recorded and updated in detail, thus maintaining the consistency of the product performance.
- Application Deployment - The applications can be managed in Ansible from Development to Production when you define and manage the applications using Ansible.
- Orchestration - To manage as a whole and how the configurations interact.
- Security and Compliance - Wide security policy can be deployed across the infrastructure when the policy is defined in Ansible
- Cloud Provisioning - Helps to automate and manage the process
Benefits of using Ansible:
- Agentless –There are no agents or software deployed on the clients/servers to work with Ansible. The connection can be done through SSH or using Python.
- English Like Language – To use the Ansible, configure, and deploy the infrastructure is very simple and it is English like the language used called YAML.
- Modular – The Ansible uses modules to automate, configure, deploy, and orchestrate the IT Infrastructure. There are around 750 + modules built-in Ansible.
- Efficient – There are no servers, daemons, or databases required for Ansible to work.
- Features – Ansible comes with a whole lot of features and can be used to manage the Operating systems, IT Infrastructure, networks, servers, and services in very little time.
- Secure and consistent – Since Ansible uses SSH and Python it is very secure and the operations are flawless.
- Reliable – The Ansible Playbook can be used to write programs or modules and can be used to manage IT without any downside.
- Performance- The Ansible’s performance is excellent and has very little latency.
- Low Overhead – As it is agentless and does not require any servers, daemons, or databases it can provide a lot of space in the systems and has low overhead in terms of deployment.
- Simple – It is very simple to use and is supported by YAML
Why Ansible?
Ansible is very useful and you would appreciate it with the example when there are 4 or 5 web servers to be configured and deployed, and when there are more than 4 database servers to be configured and deployed. There are applications in the web servers and it connects the database servers at the backend. Now the traditional situation demands that you separately configure these servers and manage them.
However, these servers will have various application updates. Even a system admin cannot handle it if there are more servers and their configurations will not be identical. These tasks are complex to do and to manage the number of servers without putting a lot of effort into system admin as well as by developers who are developing the applications. Just imagine other servers which the organization has such as DNS, NTP, AD, Email, etc
This is where Ansible comes into the picture. Infrastructure automation and orchestrations can be done by Ansible. All the similar servers can be handled and managed in one go by Ansible.
Ansible Architecture:
The Ansible orchestration engine interacts with a user who is writing the Ansible playbook to execute the Ansible orchestration and interact along with the services of private or public cloud and configuration management database.
It uses no agents and no additional custom security infrastructure, so it’s easy to deploy - and most importantly, it uses a very simple language (YAML, in the form of Ansible Playbooks) that allow you to describe your automation jobs in a way that approaches plain English.
Terminologies Used in Ansible :
Controller Node: The machine where Ansible is installed, responsible for running the provisioning on the servers you are managing.
Managed Node: Remote systems are known as Managed Hosts or Managed nodes. Ansible is only installed on the control node and not the managed hosts.
Module: Basically, a module is a command or set of similar Ansible commands meant to be executed on the client-side
Task: The task is a section that consists of a single procedure to be completed
Role: A way of organizing tasks and related files to be later called in a playbook
Fact: Information fetched from the client system from the global variables with the gather-facts operation
Inventory: The file containing data about the ansible client servers. Defined in later examples as hosts file
Play: Execution of a playbook
Handler: A task that is called only if a notifier is present
Notifier: Section attributed to a task which calls a handler if the output is changed
Tag: Name set to a task which can be used later on to issue just that specific task or group of tasks.
API: Various APIs (application programming interfaces) are available so you can extend Ansible’s connection types (meaning more than just SSH for transport), callbacks, and more.
Playbooks: Ansible playbooks are like instruction manuals for tasks. They are simple files written in YAML, which stands for YAML Ain’t Markup Language, a human-readable data serialization language. Playbooks are really at the heart of what makes Ansible so popular is because they describe the tasks to be done quickly and without the need for the user to know or remember any particular syntax.
Plugins: Plugins are extra pieces of code that augment functionality. Ansible comes with a number of plugins, but you can write your own as well. Action, cache, and callback plugins are three examples.
Advantages Of Using Ansible
Modular: Only one program per script, this way I can spread the programs across different servers.
Simple: Shell scripts are extremely simple and don’t need any other software installed.
One-click: I only have to run the shell script once and everything is setup.
Agnostic: Most programmers can figure out a shell and don’t need to know how to use a specific program.
Versioning: Since my code is on GitHub a simple Git pull and restart all of the supervisors will run my latest code.
Agentless: Finally, Ansible is completely agentless. There are no agents/software or additional firewall ports that you need to install on the client systems or hosts which you want to automate.
Powerful & Flexible: Ansible has powerful features that can enable you to model even the most complex IT workflows. It can manage the infrastructure, networks, operating systems and services that you are already using, as Ansible provides you with hundreds of modules to manage them.
Efficient: No extra software on your servers means more resources for your applications. Also, since Ansible modules work via JSON, Ansible is extensible with modules written in a programming language you already know. Ansible introduces modules as basic building blocks for your software. So, you can even customize it as per your needs.
Automatic step-by-step reporting: Ansible encourages you to name each ‘task’ in your provisioning script, and then reports whether or not that task succeeded with-or-without changes, or failed, and any error messages. All color-coded.
A library of ready-made idempotent ‘modules’ with a standardized option format for dealing with common operations. A lot of the idempotency you get with Ansible can be achieved through careful shell scripting – always using mkdir -p, carefully cleaning and force-checkouting git repos, etc.
Ansible for DevOps
Ansible is the most preferred DevOps tool for orchestration, automation, configuration, and managing the IT Infrastructure. The benefit of Ansible in DevOps is to respond and scale in pace with the demand. The following are the benefits of Ansible in DevOps,
- The feedback loop is accelerated at a faster rate
- The bugs are found sooner and not wait till the end
- Risk due to lack of sufficient knowledge is mitigated
- The deployments are reliable
- The IT infrastructure is coordinated
- The deployments are faster
- Need for automation
- Version control and configuration management
- Orchestration of the IT Infrastructure.
Ansible Case Study: National Aeronautics and Space Administration (NASA)
“Ansible Tower has allowed us to provide better operations and security to our clients. It has also increased our efficiency as a team.”
Business Challenge:
NASA needed to move roughly 65 applications from a traditional hardware-based data center to a cloud-based environment for better agility and cost savings. The rapid timeline resulted in many applications being migrated ‘as-is’ to a cloud environment. This created an environment spanning multiple virtual private clouds (VPCs) and AWS accounts that could not be easily managed. Even simple things, like ensuring every system administrator had access to every server, or simple patching, were extremely burdensome.
Solution:
Leverage Ansible Tower to manage and schedule the cloud environment.
Results:
As a result of implementing Ansible Tower, NASA is better equipped to manage its AWS environment. Tower allowed NASA to provide better operations and security to its clients. It has also increased efficiency as a team.
By the numbers:
? Updating nasa.gov went from over 1 hour to under 5 minutes
? Patching updates went from a multi-day process to 45 minutes
? Achieving near real-time RAM and disk monitoring (accomplished without agents)
? Provisioning OS Accounts across an entire environment in under 10 minutes
? Baselining standard AMIs went from 1 hour of manual configuration to becoming an invisible and seamless background process
? Application stack set up from 1-2 hours to under 10 minutes per stack
Conclusion:
In a world with technology that is continuously changing at a swift pace and growing incredibly fast at the same time, system administrators and DevOps engineers must think of different approaches on how to automate routine tasks and orchestrate large pools of servers.
Ansible is popular for its simplicity of installation, ease of use in what concerns the connectivity to clients, its lack of agent for Ansible clients, and the multitude of skills.
So, here we learned that how a Bigger organization like NASA uses Ansible to solve the challenges.
Thanks for reading the article.
I hope this article was helpful to you!!!!
You can appreciate the article by giving it a like and posting comments about your feedback.