Ansible (software)
{{Short description|Open-source software platform for remote configuring and managing computers}}
{{About|the software named Ansible|3=Ansible (disambiguation)}}
{{Technical|date=April 2022}}
{{Infobox software
| name = Ansible
| logo = Ansible logo.svg
| logo size = 100px
| screenshot =
| caption =
| collapsible =
| author = Michael DeHaan
| developer = [https://github.com/orgs/ansible/people Ansible Community] / Ansible Inc. / Red Hat Inc.
| released = {{Start date and age|2012|02|20}} {{citation needed|date=January 2023}}
| latest release version = {{wikidata|property|reference|edit|P348}}
| latest release date = {{wikidata|qualifier|P348|P577}}
| latest preview version =
| latest preview date =
| programming language = Python, PowerShell, Shell
| operating system = Linux, Unix-like, MacOS, Windows
| platform =
| size =
| language = English
| genre = Configuration management, infrastructure as code (IaC), Orchestration engine
| license = GNU General Public License version 3
}}
Ansible is a suite of software tools that enables infrastructure as code. It is open-source and the suite includes software provisioning, configuration management, and application deployment functionality.{{cite web|title=Overview – How Ansible Works |url=https://www.ansible.com/how-ansible-works |website=ansible.com |author=Staff writer |publisher=Red Hat, Inc. |pages=1 |access-date=December 7, 2016}}
Originally written by Michael DeHaan in 2012, and acquired by Red Hat in 2015, Ansible is designed to configure both Unix-like systems and Microsoft Windows. Ansible is agentless, relying on temporary remote connections via SSH or Windows Remote Management 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.{{cite web|title=Ansible Documentation-Installation Guide |url=https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#control-node-requirements |website=docs.ansible.com |access-date=July 7, 2022}} System configuration is defined in part by using its own declarative language.
History
The term "ansible" was coined by Ursula K. Le Guin in her 1966 novel Rocannon's World,{{cite book |last1=Bernardo |first1=Susan |first2=Graham J |last2=Murphy|title=Ursula K. Le Guin : a critical companion |url=https://archive.org/details/ursulakleguincri00bern |url-access=limited |publisher=Greenwood Press |location=Westport, Conn |year=2006 |isbn=978-0-313-02730-7 |page=[https://archive.org/details/ursulakleguincri00bern/page/n32 18] |oclc=230345464 }} and refers to fictional instantaneous communication systems.{{cite web |url=https://docs.ansible.com/ansible/latest/reference_appendices/faq.html |title=Frequently Asked Questions |website=docs.ansible.com |series=Ansible Documentation |publisher=Red Hat, Inc. |pages=1 |access-date=March 7, 2023 }}{{Cite web |url=https://groups.google.com/d/msg/ansible-project/djZklLE2wIE/XCEOIq0RbN4J |title=Google Groups Post – Ansible Project |last=DeHaan |first=Michael |date=January 29, 2014 |website=groups.google.com |pages=1 |access-date=April 26, 2017 }}
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 (Func) framework for remote administration.{{cite web|url=http://www.coloandcloud.com/editorial/an-interview-with-ansible-author-michael-dehaan|title=An Interview with Ansible Author Michael DeHaan|last=Maughan|first=Mike|date=April 17, 2012|website=coloandcloud.com|publisher=Maughansem LLC|pages=1|archive-url=https://web.archive.org/web/20121114031927/http://www.coloandcloud.com/editorial/an-interview-with-ansible-author-michael-dehaan/|archive-date=November 14, 2012|url-status=dead|access-date=November 5, 2012}}
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.{{cite web |url=http://www.ansible.com |archive-url=https://web.archive.org/web/20150905211125/http://www.ansible.com/about |archive-date=September 5, 2015 |title=About Ansible |access-date=July 8, 2016 |publisher=Ansible, Inc. |pages=1 }}{{cite web |url=https://www.bloomberg.com/research/stocks/private/snapshot.asp?privcapId=233465248 |title=Ansible, Inc.: Private Company Information |author=Bloomberg Research |access-date=July 8, 2016 |work=Internet Software and Services |publisher=Bloomberg L.P. |pages=1 }}{{Cite web|date=2015-09-05|title=About Team|url=http://www.ansible.com/about-team|access-date=2021-04-07|archive-url=https://web.archive.org/web/20150905195548/http://www.ansible.com/about-team|archive-date=2015-09-05}} Red Hat acquired Ansible in October 2015.{{cite web |url=https://venturebeat.com/2015/10/15/source-red-hat-is-buying-ansible-for-more-than-100m/ |title=Source: Red Hat is buying Ansible for more than $100M |last1=Novet |first1=Jordan |website=venturebeat.com |publisher=VentureBeat, Inc. |date=October 15, 2015 |access-date=October 16, 2015 |pages=1 }}{{cite web |url=http://www.redhat.com/en/about/press-releases/red-hat-acquire-it-automation-and-devops-leader-ansible |title=Red Hat to Acquire IT Automation and DevOps Leader Ansible |author=Staff writer |work=redhat.com |publisher=Red Hat, Inc. |date=October 16, 2015 |access-date=October 16, 2015}}
Ansible is included as part of the Fedora distribution of Linux, owned by Red Hat, and is also available for Red Hat Enterprise Linux, CentOS, openSUSE, SUSE Linux Enterprise, Debian, Ubuntu, Scientific Linux, and Oracle Linux via Extra Packages for Enterprise Linux, as well as for other operating systems.{{cite web |url=https://pkgs.org/download/ansible |title=ansible Download (DEB, RPM, TGZ, TXZ, XZ) |last=Ulianytskyi |first=Mykola |website=pkgs.org |publisher=Linux Packages Search |pages=1 |access-date=November 5, 2012}}
Architecture
= Overview =
Ansible helps to manage multiple machines by selecting portions of Ansible's inventory stored in simple plain text files. The inventory is configurable, and target machine inventory can be sourced dynamically or from cloud-based sources in different formats (YAML, INI).{{cite web|title=Inventory|url=https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html|access-date=March 7, 2023|website=docs.ansible.com|series=Ansible Documentation|publisher=Red Hat, Inc.|pages=1}}
Sensitive data can be stored in encrypted files using Ansible Vault{{Cite web|title=Ansible Vault — Ansible Documentation|url=https://docs.ansible.com/ansible/latest/user_guide/vault.html|website=docs.ansible.com}} since 2014.{{Cite web|title=Ansible vault: a framework for encrypting any playbook or var file. · ansible/ansible@427b8dc|url=https://github.com/ansible/ansible/commit/427b8dc78de43aa02be968bbbcb2f10ed487fe1e|website=GitHub}}
In contrast with other popular configuration-management software — such as Chef, Puppet, Salt and CFEngine — Ansible uses an agentless architecture,{{cite web|title=The Benefits of Agentless Architecture|url=http://cdn2.hubspot.net/hub/330046/file-479013288-pdf/pdf_content/The_Benefits_of_Agentless_Architecture.pdf?t=1390852839000|publisher=Red Hat, Inc.|pages=5|format=PDF}} 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-based protocol via its standard input and output.{{cite web|title=Ansible in Depth|url=http://cdn2.hubspot.net/hub/330046/file-480366556-pdf/pdf_content/Ansible_in_Depth.pdf?t=1390852822000|publisher=Red Hat, Inc.|pages=5|format=PDF}} When Ansible is not managing a node, it does not consume resources on the node because no daemons are run or software installed.
== Dependencies ==
= Control node =
The control node (master host) is intended to manage (orchestrate) target machines (nodes termed as "inventory", see below).{{Cite web|title=Ansible concepts — Ansible Documentation|url=https://docs.ansible.com/ansible/latest/user_guide/basic_concepts.html|access-date=2021-11-19|website=docs.ansible.com}} Control nodes can be run from Linux and Unix-like operating systems (including MacOS); Windows OSs are only supported through the Windows Subsystem for Linux.{{Cite web|title=Installing Ansible|url=https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html|access-date=2023-01-04|website=docs.ansible.com}} 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.{{Cite web|url=http://docs.ansible.com/ansible/latest/intro_installation.html#managed-node-requirements|title=Installation Guide — Ansible Documentation|website=docs.ansible.com|language=en|access-date=2018-11-30}}
- Reliable. When carefully written, an Ansible playbook can be idempotent, to prevent unexpected side effects on the managed systems.{{cite web |url=http://cdn2.hubspot.net/hub/330046/file-479069823-pdf/pdf_content/Achieving_Rolling_Updates_and_Continuous_Deployment_with_Zero_Downtime.pdf |title=Achieving Rolling Updates and Continuous Deployment with Zero Downtime |publisher=Red Hat, Inc. |pages=7 }} 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{{Cite web|url=https://docs.ansible.com/ansible/latest/collections/index_module.html|title=Module Index — Ansible Documentation|website=docs.ansible.com}} are mostly standalone and can be written in a standard scripting language (such as Python, Perl, Ruby, Bash, etc.){{Citation needed|reason=I have been working on Ansible for about half a decade, and I know for a fact that you can write Ansible modules in any language, provided the language is Python.|date=September 2023}}. 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.{{Primary source inline|date=November 2021}}
= Inventory configuration =
Location of target nodes is specified through inventory configuration lists (INI or YAML formatted) located at {{Code|/etc/ansible/hosts}} (on Linux).{{Cite web|title=Working with Inventory — Ansible Documentation|url=http://docs.ansible.com/ansible/latest/intro_inventory.html|access-date=2018-11-30|website=docs.ansible.com|language=en}} The configuration file lists either the IP address or hostname of each node that is accessible by Ansible. In addition, nodes can be assigned to groups.
An example inventory format (INI file):
192.168.6.1
[webservers]
foo.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,{{cite web |title=Dynamic Inventory |url=http://docs.ansible.com/ansible/intro_dynamic_inventory.html |archive-url=https://web.archive.org/web/20190805173530/https://docs.ansible.com/ansible/latest/user_guide/intro_dynamic_inventory.html |archive-date=August 5, 2019 |access-date=November 25, 2016 |website=docs.ansible.com |series=Ansible Documentation |publisher=Red Hat, Inc. |pages=1}} and supports groups of groups.{{Cite web|url=https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html|title=How to build your inventory — Ansible Documentation|website=docs.ansible.com}}
= Playbooks =
Playbooks are YAML files that store lists of tasks for repeated{{cite web |url=https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_intro.html |title=Playbooks |website=docs.ansible.com |series=Ansible Documentation |publisher=Red Hat, Inc. |pages=1 |access-date=March 7, 2023 }} executions on managed nodes.{{Cite web|title=Intro to playbooks — Ansible Documentation|url=https://docs.ansible.com/ansible/latest/user_guide/playbooks_intro.html#about-playbooks|access-date=2021-11-19|website=docs.ansible.com}} Each Playbook maps (associates) a group of hosts to a set of roles. Each role is represented by calls to Ansible tasks.{{cite web |title=Task And Handler Organization For A Role |url=http://docs.ansible.com/ansible/playbooks_best_practices.html#task-and-handler-organization-for-a-role |archive-url=https://web.archive.org/web/20170717215320/http://docs.ansible.com:80/ansible/playbooks_best_practices.html |archive-date=July 17, 2017 |access-date=November 25, 2016 |website=docs.ansible.com |series=Ansible Documentation |publisher=Red Hat, Inc. |pages=1}}
= Ansible Automation Platform =
{{anchor|AWX}}
The Ansible Automation Platform (AAP) 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 from 17+ upstream open source projects including the AWX upstream project (formerly Ansible Tower), which has been open source since September 2017.{{cite web |url=https://www.reddit.com/r/ansible/comments/46juz4/ansible_announces_tower_to_be_open_source_in_the/ |title=Ansible announces Tower to be Open Source in the near future on AnsibleFest! |author=Redditors |date=February 19, 2016 |website=reddit.com |publisher=Reddit |pages=1 |access-date=July 20, 2017 }}{{cite web |url=https://www.ansible.com/open-tower |title=The Open Tower Project |author=Staff writer |website= ansible.com/open-tower |publisher=Red Hat, Inc. |pages=1 |access-date=January 21, 2017 }}{{Cite web|url=https://www.ansible.com/products/awx-project/faq|title=AWX Project FAQ | Ansible.com|first=Ansible, Red|last=Hat|website=www.ansible.com|date=7 May 2024 }}{{Cite web|url=https://github.com/ansible/awx|title=ansible/awx|date=March 25, 2020|via=GitHub}}
There also is another open source alternative to Tower, Semaphore, written in Go.{{cite web |author=Semaphore community |title=Semaphore API |url=https://www.ansible-semaphore.com/api-docs/ |access-date=Sep 19, 2023 |website=ansible-semaphore.com |pages=1}}{{cite web |url=https://github.com/ansible-semaphore/semaphore |title=ansible-semaphore |author=Semaphore community |website=github.com/ansible-semaphore |publisher=Castaway Consulting LLC |access-date=Feb 5, 2021 }}
Platform support
Control machines have to be a Linux/Unix host (for example BSD, CentOS, Debian, macOS, Red Hat Enterprise Linux, SUSE Linux Enterprise, Ubuntu), and Python 2.7 or 3.5 is required.{{cite web |title=Python 3 Support |url=http://docs.ansible.com/ansible/python_3_support.html |archive-url=https://web.archive.org/web/20170710001211/https://docs.ansible.com/ansible/python_3_support.html |archive-date=July 10, 2017 |access-date=July 6, 2017 |website=docs.ansible.com |series=Ansible Documentation |publisher=Red Hat, Inc. |pages=1}}
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.{{cite web |url=https://docs.ansible.com/ansible/latest/getting_started/index.html |title=Getting started |website=docs.ansible.com |series=Ansible Documentation |publisher=Red Hat, Inc. |pages=1 |access-date=March 7, 2023 }} Since version 1.7, Ansible can also manage Windows{{cite web |url=http://www.ansible.com/blog/ansible-1.7-is-released-windows-beta-and-more |title=Ansible 1.7 is released – Windows beta and more! |date=August 6, 2014 |last=DeHaan |first=Michael |website=ansible.com/blog |series=The Inside Playbook |publisher=Ansible, Inc. |pages=1 |access-date=August 7, 2014 }} 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.{{cite web |url=https://www.ansible.com/ansiblefest |title=AnsibleFest |website=Ansible |publisher=Red Hat, Inc. |access-date=October 4, 2018}}
class="wikitable"
!Year !Location |
2013
|New York, New York, US |
2013
|San Francisco, California, US |
2014
|New York, New York, US |
2014
|San Francisco, California, US |
2015
|London, UK |
2015
|New York, New York, US |
2015
|San Francisco, California, US |
2016
|London, UK |
2016
|San Francisco, California, US |
2016
|Brooklyn, New York, US |
2017
|London, UK |
2017
|San Francisco, California, US |
2018
|Austin, Texas, US |
2019
|Atlanta, Georgia, US |
2020
|Virtual only due to COVID-19 pandemic |
2021
|Virtual only due to COVID-19 pandemic |
2022
|Chicago, Illinois, US |
2023
|Boston, Massachusetts, US |
2024
|Denver, Colorado, US |
2025
|Boston, Massachusetts, US{{Cite web|url=https://www.redhat.com/en/blog/save-date-red-hat-summit-2025|title=Save the date for Red Hat Summit 2025|website=www.redhat.com}} |
See also
{{Portal|Free and open-source software}}
References
{{Reflist}}
External links
- {{Official website}}
{{Red Hat}}
{{Authority control}}
Category:Free software programmed in Python
Category:Configuration management
Category:Orchestration software
Category:Remote administration software