An Overview Of Ansible

An Overview Of Ansible
Techiio-author
Written by Shuvhojit DebDecember 22, 2021
12 min read
Ansible
2 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 2 VIEWS SHARE
Techiio-author
Shuvhojit Deb

Full Stack Developer

In this blog, we'll know about Ansible.

What is Ansible?

Ansible is a software tool that provides simple but powerful automation for cross-platform computer support. 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.

blogpost

How does Ansible work?

Ansible works by connecting to your nodes and pushing out small programs, called modules to them. Modules are used to accomplish automation tasks in Ansible.

These programs are written to be resource models of the desired state of the system. Ansible then executes these modules and removes them when finished.

Without modules, you’d have to rely on ad-hoc commands and scripting to accomplish tasks.

Ansible is agentless, which means the nodes it manages do not require any software to be installed on them.

Ansible reads information about which machines you want to manage from your inventory. Ansible has a default inventory file, but you can create your own and define which servers you want Ansible to manage.

Ansible uses SSH protocol to connect to servers and run tasks. By default, Ansible uses SSH keys with ssh-agent and connects to remote machines using your current user name. Root logins are not required. You can log in as any user, and then su or sudo to any user.

Once it has connected, Ansible transfers the modules required by your command or playbook to the remote machine(s) for execution.

Ansible uses human-readable YAML templates so users can program repetitive tasks to happen automatically without having to learn an advanced programming language.

Ansible contains built-in modules that you can use to automate tasks, or you can write your own. Ansible modules can be written in any language that can return JSON, such as Ruby, Python, or bash. Windows automation modules are even written in Powershell.

Advantages of Ansible

Simple/Easy-to-Learn

This is perhaps Ansible’s most lauded attribute: users can get up to speed and be productive quickly with the tool. Supported by clear, easy-to-follow documentation, one can learn the workflow and logic of Ansible’s operations in a short amount of time. A lack of a dependency system means Ansible tasks just run sequentially and stop when an error is encountered. This makes troubleshooting easier, especially when initially starting with the tool.

Agentless

For managing nodes, Ansible handles all master/agent communications with standard SSH or the Paramiko module, which is a Python implementation of the SSH2. The tool doesn’t require any agents to be installed on remote systems to be managed, which means less maintenance overhead and performance degradations.

YAML-Based Playbooks

Playbooks– Ansible configuration files– are written in YAML, which for configuration management and automation purposes is a better fit than other formats such as JSON. It’s easier to read, supports comments, and employs the use of anchors for referencing other items.

Written in Python

Ansible was written in Python, unlike other competing solutions that were built with languages such as Ruby. Consequently, getting it up and running is easier, since Python libraries are by default present on most Linux distributions. It’s also a language that’s more common for administration and scripting tasks: engineers and systems administrators are more likely to know Python than Ruby. Ansible modules for extending the tool’s functionality, however, can be written in any language, just as long as it returns data in JSON format.

Ansible Galaxy

This portal serves as the central repository for finding, reusing, and sharing Ansible content. For example, reusable Roles for server configuration or application installation can be downloaded for use in one’s playbooks, significantly accelerating deployment time.

Disadvantages of Ansible

No Notion of State

Unlike comparable automation tools like Puppet, Ansible has no notion of state. Since it doesn’t keep track of dependencies, the tool simply executes a sequential series of tasks, stopping when it finishes, fails, or encounters an error. For some, this simplistic model of automation is desirable; however, many prefer their automation tool to maintain an extensive catalog for ordering (à la Puppet), allowing them to reach a defined state regardless of any variance in environmental conditions.

UI is Lacking

Originally a command-line-only tool, Ansible made a first attempt at a UI with AWX: a graphical user interface and REST endpoint to make infrastructure management easier. AWX eventually evolved into Ansible Tower, a web management UI that provides visual management capabilities and a team-based workflow tool. Though a serious improvement over AWX, Ansible Tower still has much room for improvement only 85% of what can be done from the command line can be accomplished via the UI. Another common annoyance is that the GUI occasionally falls out of sync with the command line, resulting in different query results. Overall, Ansible Tower is still a work-in-progress, and cannot do everything that the command line interface can.

Minimal Enterprise Support Experience

Through Ansible’s Enterprise Tower and Premium Tower are targeted at medium-to-large enterprises-- both options offer extended support options: enterprise 8x5 support & SLA (4-hour critical incident response) and premium 24x7 support & SLA (2-hour critical incident response), respectively-- the company has had less experience working with large enterprises than competitors like Chef and Puppet.

Nascent Windows Support

As of version 1.7, Ansible supports both Unix/Linux and Windows nodes. For the latter, it uses native PowerShell remoting (as opposed to SSH), and a Linux control machine is still required for managing Windows hosts. Ansible is still early in its efforts to extend support for Windows, with future versions of Ansible ostensibly incorporating deeper Windows interoperability.

Conclusion

Ansible is a game-changer in how you manage the infrastructure. It not only helps you in managing infra but in a fast, efficient, and easy way. It also ensures a single source of truth as all the configuration can be managed as text which is handled with VCS for the audit trail.

With Ansible, we can not just do a server setup but also configuration management and orchestration & a lot more in an automated manner.

Ansible
2 VIEWS 0 LIKES 0 DISLIKES SHARE
0 LIKES 0 DISLIKES 2 VIEWS SHARE
Was this blog helpful?
techiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plantechiio-price-plan
You must be Logged in to comment
Code Block
Techiio-author
Shuvhojit Deb
Full Stack Developer
Techiio-followerTechiio-follower
117 Blog Posts
0 Discussion Threads
Trending Technologies
15
Software40
DevOps46
Frontend Development24
Backend Development20
Server Administration17
Linux Administration26
Data Center24
Sentry24
Terraform23
Ansible83
Docker70
Penetration Testing16
Kubernetes21
NGINX20
JenkinsX17
Techiio-logo

Techiio is on the journey to build an ocean of technical knowledge, scouring the emerging stars in process and proffering them to the corporate world.

Follow us on:

Subscribe to get latest updates

You can unsubscribe anytime from getting updates from us
Developed and maintained by Wikiance
Developed and maintained by Wikiance