Ansible is a suite of software tools that enables
infrastructure as code
Infrastructure as code (IaC) is the process of managing and provisioning computer data centers through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools.
The IT infrastructure manage ...
. 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 sof ...
and the suite includes software
provisioning
In telecommunication, provisioning involves the process of preparing and equipping a network to allow it to provide new services to its users. In National Security/Emergency Preparedness telecommunications services, ''"provisioning"'' equates to ...
,
configuration management, 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 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. Ansible is
agentless, relying on temporary remote connections via
SSH or
Windows Remote Management which allows
PowerShell
PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-sou ...
execution. The Ansible control node runs on most Unix-like systems that are able to run
Python, including Windows with
Windows Subsystem for Linux
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 serv ...
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 ap ...
.
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 de ...
" was coined by
Ursula K. Le Guin in her 1966 novel ''
Rocannon's World
''Rocannon's World'' is a science fiction novel by American writer Ursula K. Le Guin, her literary debut. It was published in 1966 as an Ace Double, along with Avram Davidson's ''The Kar-Chee Reign'', following the tête-bêche format. Though i ...
'',
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 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 sides ...
distribution of Linux, owned by
Red Hat, and is also available for
Red Hat Enterprise Linux
Red Hat Enterprise Linux (RHEL) is a Commercial software, commercial Open-source software, open-source Linux distribution developed by Red Hat for the commerce, commercial market. Red Hat Enterprise Linux is released in server versions for x86-6 ...
,
CentOS,
openSUSE
openSUSE () is a free and open source RPM-based Linux distribution developed by the openSUSE project.
The initial release of the community project was a beta version of SUSE Linux 10.0.
Additionally the project creates a variety of tools, s ...
,
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 compu ...
,
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 th ...
,
Scientific Linux
Scientific Linux (SL) was a Linux distribution produced by Fermilab, CERN, DESY and by ETH Zurich. It is a free and open-source operating system based on Red Hat Enterprise Linux.
This product is derived from the free and open-source software m ...
, and
Oracle Linux
Oracle Linux (abbreviated OL, formerly known as Oracle Enterprise Linux or OEL) is a Linux distribution packaged and freely distributed by Oracle, available partially under the GNU General Public License since late 2006. It is compiled from Red ...
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 sh ...
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 a ...
,
Puppet
A puppet is an object, often resembling a human, animal or Legendary creature, 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 ...
,
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 quanti ...
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 s ...
-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 sh ...
", 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, which i ...
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 ...
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
OpenSSH (also known as OpenBSD Secure Shell) is a suite of secure networking utilities based on the Secure Shell (SSH) protocol, which provides a secure channel over an unsecured network in a client–server architecture.
Network Working G ...
and Python are required on the managed nodes.
* Reliable. When carefully written, an Ansible
playbook
Playbook may refer to:
* BlackBerry PlayBook, a tablet computer by BlackBerry
*A book that contains a script or story for a theatrical play. This written version of the composition is used in preparing for a performance
**Fleury Playbook, a medieva ...
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 programming language, high-level, General-purpose programming language, general-purpose, Interpreter (computing), interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it ...
,
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 sapp ...
, 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
In computer networking, a hostname (archaically nodename) is a label that is assigned to a device connected to a computer network and that is used to identify the device in various forms of electronic communication, such as the World Wide Web. Hos ...
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,
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 (computer), Mac computers. Within the market of ...
,
Red Hat Enterprise Linux
Red Hat Enterprise Linux (RHEL) is a Commercial software, commercial Open-source software, open-source Linux distribution developed by Red Hat for the commerce, commercial market. Red Hat Enterprise Linux is released in server versions for x86-6 ...
,
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 compu ...
,
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 th ...
), 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
In computer science, bare machine (or bare metal) refers to a computer executing instructions directly on logic hardware without an intervening operating system. Modern operating systems evolved through various stages, from elementary to the pr ...
hosts,
virtual machines
In computing, a virtual machine (VM) is the virtualization/ emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized hard ...
, 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
*
Infrastructure as code
Infrastructure as code (IaC) is the process of managing and provisioning computer data centers through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools.
The IT infrastructure manage ...
(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