What is Ansible, for the anxious: Ansible is an IT automation platform available as free software that facilitates application deployment, multi-level orchestration and infrastructure configuration management.
What is the context?
Our interest in these products stems from a firm vocation for accelerate value delivery ("The move to production"), aligning conversations with the software build, assurance, and IT provisioning processes. The ability to systematize and automate them is the technical factor that gives life and credibility to this aspiration.
There are several players that participate in this scenario: orchestrators, containers, virtualizers, automators, etc. We serve all of this packaged as DevOps tools.
Some of the players are:
- Specialized: VirtualBox, Puppet, Vagrant, Docker, Chef or Ansible.
- Generalists: IBM, HP, Oracle ...
In IT infrastructure automation, the general scheme that is being applied is a language that allows to formalize / describe the characteristics of the IT infrastructure and a platform that executes orders automatically. In this area, Chef, Puppet and Ansible stand out.
Like everything, each one has its nuances. For our part, we consider Ansible to strike a good balance: a moderate learning curve, good capacity and ...
… A very energetic Ansible community (including a commercial evolution path).
The activities that we can propose with this technology are:
- Centralized IT configuration management
- Automated application deployment
- Multi-level IT orchestration (virtual machines / containers - infrastructure / servers - products / applications)
.. towards continuous deployment… and beyond!
Within our lines of work related to IT infrastructures, we consider Ansible as one of the tools with the best projection because it contributes in our journey towards Continuous Software Quality.
Ok, but what is Ansible?
Ansible is an IT automation platform available as free software that stands out for using an agentless architecture, unlike other configuration control programs such as Chef and Puppet.
It combines multi-node installation, ad hoc task executions, and configuration management. It manages nodes via SSH and does not require any additional remote software (except Python 2.4 or later) to install it.
Ansible has modules that work on JSON for data exchange and admits that the standard output is written in any language. In addition, it natively uses YAML to describe reusable system configurations.
Ansible's design includes:
- "Minimal by nature". Ideally, IT infrastructure management systems do not impose additional dependencies (ideally :-).
- "Consistent". It comes with "batteries included", that is, with a rich library of pre-built components.
- "Sure". Ansible does not install vulnerable agents on nodes.
- "High reliability". The idempotency model is applied for installations and configurations, to prevent secondary effects in the repetitive execution of scripts.
- "Smooth learning curve". The playbooks use a simple descriptive language, based on YAML.
With these wickers it facilitates the deployment of applications, multi-level orchestration and configuration management. For this we have the following components:
Modules are the units of work in Ansible. Each module is self-sufficient and can be written in standard scripting language, such as Python, Perl, Ruby, Bash, etc. One of the main properties of modules is the idempotency which ensures that no operation will be performed once the system has reached the desired state.
Through the Playbooks, the configurations, orchestrations and deployments in Ansible are expressed.
The format of the Playbooks is YAML. Each Playbook groups a set of instructions for one purpose.
Thus, a «Playbook» contains «Plays»,
each «Play» contains «Tasks»,
each "Task" calls "Modules".
A sample of Playbook format:
- Name: install and start apache
hosts: web servers
- name: install httpd
yum: name = httpd state = present
- name: start httpd
service: name = httpd state = running
Where to continue?
Although the term ansible is used in science fiction literature to describe a hypothetical faster-than-light communication device, we cannot say that its learning curve is instantaneous. Therefore, now it is time to expand this succinct compilation taking advantage of the excellent documentation available:
- https://galaxy.ansible.com/ "Sharing is caring"
- To the puddle! https://github.com/ansible/ansible
- Without forgetting the omnipresent wikipedia (It is a good summary, but beware, Ansible is already available for MS Windows ... although it is not his favorite dish).
Welcome to the exciting journey from infrastructure automation to deployment automation. The pipes of the Continuous Delivery ("Continuous Delivery pipelines") are waiting for you around the corner, see you there!