What is Ansible?
Ansible Red Hat: Ansible is an open source IT Configuration Management, Deployment & Orchestration tool. It aims to provide large productivity gains to a wide variety of automation challenges. This tool is very simple to use yet powerful enough to automate complex multi-tier IT application environments.
Why do we need Ansible?
Controller Machine: The machine where Ansible is installed, responsible for running the provisioning on the servers you are managing.
Inventory: An initialization file that contains information about the servers you are managing.
Task: A block that defines a single procedure to be executed, e.g. Install a package.
Module: A module typically abstracts a system task, like dealing with packages or creating and changing files. Ansible has a multitude of built-In modules, but you can also create custom ones.
Role: A pre-defined way for organizing playbooks and other files in order to facilitate sharing and reusing portions of a provisioning.
Facts: Global variables containing information about the system, like network interfaces or operating system.
Handlers: Used to trigger service status changes, like restarting or stopping a service.
Advantages of using Ansible
Simple: Ansible uses a simple syntax written in YAML called playbooks. YAML is a human-readable data serialization language.
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 and Flexible: Ansible has powerful features that can enable you to model even the most complex IT workflows.
Efficient: No extra software on your servers means more resources for your applications. Also, since ansible modules work vía JSON, ansible is extensible with modules written in a programming language you already know.
What Ansible can do?
Provisioning: Helps to streamline this process
Configuration Management: It establishes and maintains consistency of the product performance by recording and updating detalled information which describes an enterprise´s hardware and software.
Orchestration: Configurations alone don´t define your environment. You need to define how multiple configurations interact and ensure the disparate pieces can be managed as a whole.
Application Deployment: When you define your application with ansible, and manage the deployment with ansible tower, teams are able to effectively manage the entire application life cycle from development to production.
Security and Compliance: When you define your security policy in ansible, scanning and remediation of site. Wide security policy can be integrated into everything that is deployed.
Ansible architecture is fairly straightforward. Refer to the diagram below to understand the ansible architecture.
Ansible in DevOps
In DevOps, as we know development and operations work is integrated. This integration is very important for modern test-driven application design, hence, ansible integrates this by providing a stable environment to both development and operations resulting in smooth orchestration, refer to the image below to see how ansible fits into DevOps.
Real- Life usage of Ansible by NASA
Ansible Tower provided with a dashboard which provided the status summary of all hosts and jobs which allowed NASA to group all contents and manage access permissions across different departments. It also helped to split up the organization by associating content and control permission for groups as well.
Ansible Tower is a web-based interface for managing Ansible. One of the top items in Ansible users’ wishlists was an easy-to-use UI for managing quick deployments and monitoring one’s configurations. Ansible management came up with Ansible Tower in response.
Further, Ansible divided the tasks among teams by assigning various roles. It managed the clean-up of old job history, activity streams, data marked for deletion and system tracking info. Refer to the diagram below to understand how Ansible has simplified the work of NASA.