Ansible is a suite of software tools that enables
infrastructure as code. It is
open-source
Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized so ...
and the suite includes software
provisioning,
configuration management
Configuration management (CM) is a process for establishing and maintaining consistency of a product's performance, functional, and physical attributes with its requirements, design, and operational information throughout its life. The CM proc ...
, and
application deployment
Software deployment is all of the activities that make a software system available for use.
The general deployment process consists of several interrelated activities with possible transitions between them. These activities can occur on the ...
functionality.
Originally written by Michael DeHaan and acquired by
Red Hat
Red Hat, Inc. is an American software company that provides open source software products to enterprises. Founded in 1993, Red Hat has its corporate headquarters in Raleigh, North Carolina, with other offices worldwide.
Red Hat has become a ...
in 2015, Ansible is designed to configure both
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems and
Microsoft Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for ...
. Ansible is
agentless, relying on temporary remote connections via
SSH or
Windows Remote Management
WinRM (Windows Remote Management) is Microsoft's implementation of WS-Management in Windows which allows systems to access or exchange management information across a common network. Utilizing scripting objects or the built-in command-line tool, W ...
which allows
PowerShell execution. The Ansible control node runs on most Unix-like systems that are able to run
Python, including Windows with
Windows Subsystem for Linux installed.
System configuration is defined in part by using its own
declarative language
In computer science, declarative programming is a programming paradigm—a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow.
Many languages that a ...
.
History
The term "
ansible
An ansible is a category of fictional devices or technology capable of near-instantaneous or faster-than-light communication. It can send and receive messages to and from a corresponding device over any distance or obstacle whatsoever with no d ...
" was coined by
Ursula K. Le Guin
Ursula Kroeber Le Guin (; October 21, 1929 – January 22, 2018) was an American author best known for her works of speculative fiction, including science fiction works set in her Hainish universe, and the '' Earthsea'' fantasy series. She was ...
in her 1966 novel ''
Rocannon's World'',
and refers to fictional instantaneous communication systems.
The Ansible tool was developed by Michael DeHaan, the author of the provisioning server application
Cobbler and co-author of the
Fedora Unified Network Controller
A fedora () is a hat with a soft brim and indented crown.Kilgour, Ruth Edwards (1958). ''A Pageant of Hats Ancient and Modern''. R. M. McBride Company. It is typically creased lengthwise down the crown and "pinched" near the front on both sides ...
(Func) framework for remote administration.
Ansible, Inc. (originally AnsibleWorks, Inc.) was the company founded in 2013 by DeHaan, Timothy Gerla, and Saïd Ziouani to commercially support and sponsor Ansible.
Red Hat
Red Hat, Inc. is an American software company that provides open source software products to enterprises. Founded in 1993, Red Hat has its corporate headquarters in Raleigh, North Carolina, with other offices worldwide.
Red Hat has become a ...
acquired Ansible in October 2015.
Ansible is included as part of the
Fedora
A fedora () is a hat with a soft brim and indented crown.Kilgour, Ruth Edwards (1958). ''A Pageant of Hats Ancient and Modern''. R. M. McBride Company. It is typically creased lengthwise down the crown and "pinched" near the front on both side ...
distribution of Linux, owned by
Red Hat
Red Hat, Inc. is an American software company that provides open source software products to enterprises. Founded in 1993, Red Hat has its corporate headquarters in Raleigh, North Carolina, with other offices worldwide.
Red Hat has become a ...
, and is also available for
Red Hat Enterprise Linux
Red Hat Enterprise Linux (RHEL) is a commercial open-source Linux distribution developed by Red Hat for the commercial market. Red Hat Enterprise Linux is released in server versions for x86-64, Power ISA, ARM64, and IBM Z and a desktop ...
,
CentOS
CentOS (, from Community Enterprise Operating System; also known as CentOS Linux) is a Linux distribution that provides a free and open-source community-supported computing platform, functionally compatible with its upstream source, Red Hat En ...
,
openSUSE,
SUSE Linux Enterprise
SUSE Linux Enterprise (often abbreviated to SLE) is a Linux-based operating system developed by SUSE. It is available in two editions, suffixed with Server (SLES) for servers and mainframes, and Desktop (SLED) for workstations and desktop compute ...
,
Debian
Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of De ...
,
Ubuntu
Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All ...
,
Scientific Linux, and
Oracle Linux via Extra Packages for Enterprise Linux, as well as for other operating systems.
Architecture
Overview
Ansible helps to manage multiple machines by selecting portions of Ansible's
inventory
Inventory (American English) or stock (British English) refers to the goods and materials that a business holds for the ultimate goal of resale, production or utilisation.
Inventory management is a discipline primarily about specifying the sha ...
stored in simple
ASCII
ASCII ( ), abbreviated from American Standard Code for Information Interchange, is a character encoding standard for electronic communication. ASCII codes represent text in computers, telecommunications equipment, and other devices. Because ...
text files. The inventory is configurable, and target machine inventory can be sourced dynamically or from cloud-based sources in different formats (
YAML
YAML ( and ) (''see '') is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Ext ...
,
INI).
Sensitive data can be stored in encrypted files using Ansible Vault since 2014.
In contrast with other popular configuration-management software — such as
Progress Chef
Progress Chef (formerly Chef) is a configuration management tool written in Ruby and Erlang. It uses a pure-Ruby, domain-specific language (DSL) for writing system configuration "recipes". Chef is used to streamline the task of configuring an ...
,
Puppet
A puppet is an object, often resembling a human, animal or mythical figure, that is animated or manipulated by a person called a puppeteer. The puppeteer uses movements of their hands, arms, or control devices such as rods or strings to move ...
,
Salt
Salt is a mineral composed primarily of sodium chloride (NaCl), a chemical compound belonging to the larger class of salts; salt in the form of a natural crystalline mineral is known as rock salt or halite. Salt is present in vast quant ...
and
CFEngine — Ansible uses an ''agentless'' architecture,
with
Ansible software not normally running or even installed on the controlled node.
Instead, Ansible orchestrates a node by installing and running modules on the node temporarily via SSH. For the duration of an orchestration task, a process running the module communicates with the controlling machine with a
JSON
JSON (JavaScript Object Notation, pronounced ; also ) is an open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays (or other se ...
-based protocol via its standard input and output.
When Ansible is not managing a node, it does not consume resources on the node because no
daemons are run or software installed.
Dependencies
Ansible requires
Python to be installed on all managing machines, including
pip package manager along with configuration-management software and its dependent packages. Managed network devices require no extra dependencies and are agentless.
Control node
The control node (master host) is intended to manage (orchestrate) target machines (nodes termed as "
inventory
Inventory (American English) or stock (British English) refers to the goods and materials that a business holds for the ultimate goal of resale, production or utilisation.
Inventory management is a discipline primarily about specifying the sha ...
", see below).
Control nodes are only available for
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, whi ...
and the like;
Windows
Windows is a group of several proprietary graphical operating system families developed and marketed by Microsoft. Each family caters to a certain sector of the computing industry. For example, Windows NT for consumers, Windows Server for se ...
OSs are not supported. Multiple control nodes are allowed.
Ansible does not require a single controlling machine for orchestration,
ensuring that disaster recovery is simple.
Nodes are managed by the controlling node over
SSH.
Design goals
The design goals of Ansible include:
* Minimal in nature. Management systems should not impose additional dependencies on the environment.
* Consistent. With Ansible, one should be able to create consistent environments.
* Secure. Ansible does not deploy agents to nodes. Only
OpenSSH and Python are required on the managed nodes.
* Reliable. When carefully written, an Ansible
playbook can be
idempotent
Idempotence (, ) is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. The concept of idempotence arises in a number of pl ...
, to prevent unexpected side effects on the managed systems.
It is possible to write playbooks that are not idempotent.
* Minimal learning required. Playbooks use an easy and descriptive language based on YAML and
Jinja templates.
Modules
Modules are mostly standalone and can be written in a standard scripting language (such as Python,
Perl
Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
,
Ruby
A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called ...
, Bash, etc.). One of the guiding goals of modules is idempotency, which means that even if an operation is repeated multiple times (e.g., upon recovery from an outage), it will always place the system into the same state.
Inventory configuration
Location of target nodes is specified through inventory configuration lists (INI or YAML formatted) located at (on Linux).
The configuration file lists either the
IP address
An Internet Protocol address (IP address) is a numerical label such as that is connected to a computer network that uses the Internet Protocol for communication.. Updated by . An IP address serves two main functions: network interface ident ...
or
hostname of each node that is accessible by Ansible. In addition, nodes can be assigned to groups.
An example inventory (INI format):
192.168.6.1
ebserversfoo.example.com
bar.example.com
This configuration file specifies three nodes: the first node is specified by an IP address, and the latter two nodes are specified by hostnames. Additionally, the latter two nodes are grouped under the
webservers
group.
Ansible can also use a custom ''Dynamic Inventory'' script, which can dynamically pull data from a different system, and supports groups of groups.
Playbooks
Playbooks are
YAML
YAML ( and ) (''see '') is a human-readable data-serialization language. It is commonly used for configuration files and in applications where data is being stored or transmitted. YAML targets many of the same communications applications as Ext ...
files that store lists of tasks for repeated
executions on managed nodes.
Each Playbook maps (associates) a group of hosts to a set of roles. Each role is represented by calls to Ansible tasks.
Ansible Automation Platform
The Ansible Automation Platform (APP) is a
REST API,
web service, and
web-based interface (application) designed to make Ansible more accessible to people with a wide range of IT skillsets. It is a platform composed of multiple components including developer tooling, an operations interface, as well as an Automation Mesh to enable automation tasks at scale across data centers. AAP is a commercial product supported by Red Hat, Inc. but derived 17+
upstream
Upstream may refer to:
* Upstream (bioprocess)
* ''Upstream'' (film), a 1927 film by John Ford
* Upstream (networking)
* ''Upstream'' (newspaper), a newspaper covering the oil and gas industry
* Upstream (petroleum industry)
* Upstream (software ...
open source projects including the AWX upstream project (formerly Ansible Tower derived from), which has been open source since September 2017.
There was also another open source alternative to Tower, ''Semaphore'', written in
Go.
Platform support
Control machines have to be a Linux/Unix host (for example
BSD,
CentOS
CentOS (, from Community Enterprise Operating System; also known as CentOS Linux) is a Linux distribution that provides a free and open-source community-supported computing platform, functionally compatible with its upstream source, Red Hat En ...
,
Debian
Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of De ...
,
macOS
macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac computers. Within the market of desktop and la ...
,
Red Hat Enterprise Linux
Red Hat Enterprise Linux (RHEL) is a commercial open-source Linux distribution developed by Red Hat for the commercial market. Red Hat Enterprise Linux is released in server versions for x86-64, Power ISA, ARM64, and IBM Z and a desktop ...
,
SUSE Linux Enterprise
SUSE Linux Enterprise (often abbreviated to SLE) is a Linux-based operating system developed by SUSE. It is available in two editions, suffixed with Server (SLES) for servers and mainframes, and Desktop (SLED) for workstations and desktop compute ...
,
Ubuntu
Ubuntu ( ) is a Linux distribution based on Debian and composed mostly of free and open-source software. Ubuntu is officially released in three editions: '' Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All ...
), and Python 2.7 or 3.5 is required.
Managed nodes, if they are Unix-like, must have Python 2.4 or later. For managed nodes with Python 2.5 or earlier, the
python-simplejson
package is also required.
Since version 1.7, Ansible can also manage Windows
nodes.
In this case, native PowerShell remoting supported by the WS-Management protocol is used instead of SSH.
Ansible can deploy to
bare metal hosts,
virtual machines, and cloud environments.
AnsibleFest
AnsibleFest is an annual conference of the Ansible community of users, contributors, etc.
See also
*
Comparison of open-source configuration management software
This is a comparison of notable free and open-source configuration management software, suitable for tasks like server configuration, orchestration and infrastructure as code typically performed by a system administrator.
Basic properties
"V ...
*
Infrastructure as code (IaC)
*
CFEngine (software)
References
External links
*
{{Authority control
Free software programmed in Python
Configuration management
Orchestration software
Remote administration software
Software distribution
Software using the GPL license