Английская Википедия:Ansible (software)

Материал из Онлайн справочника
Перейти к навигацииПерейти к поиску

Шаблон:Short description Шаблон:About Шаблон:Technical Шаблон:Infobox software 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.[1]

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.[2] 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,[3] and refers to fictional instantaneous communication systems.[4][5]

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.[6]

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.[7][8][9] Red Hat acquired Ansible in October 2015.[10][11]

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.[12]

<timeline>

ImageSize = width:900 height:340 PlotArea = right:30 left:30 bottom:60 top:30 DateFormat = dd/mm/yyyy Period = from:01/01/2017 till:01/01/2023 TimeAxis = orientation:horizontal Legend = orientation:vertical position:bottom columns:2 Colors =

    id:production value:green            Legend:Production
    id:extended   value:rgb(0.9,0.9,0.2) Legend:Extended_support
    id:lightline  value:rgb(0.8,0.8,0.8)

BackgroundColors = canvas:white ScaleMajor = gridcolor:lightline unit:year increment:1 start:01/01/2017

Define $vshift = 15 # move text above the bars

PlotData=

 bar:          
   color:production mark:(line,white) align:left fontsize:M
   from:30/11/2021 till:01/01/2023 shift:(-55,-4) text:"Ansible 5.0.0"
   barset:break
     color:production
     from:21/12/2021 till:01/01/2023 shift:(-13,$vshift) text:"5.1.0"
 bar:         
   color:production mark:(line,white) align:left fontsize:M
   from:18/05/2021 till:30/11/2021 shift:(-55,-4) text:"Ansible 4.0.0"
   barset:break
     color:production
     from:08/06/2021 till:30/11/2021 shift:(-13,$vshift) text:"4.1.0"
 bar:        
   color:production mark:(line,white) align:left fontsize:M
   from:16/02/2021 till:18/05/2021 shift:(-55,-4) text:"Ansible 3.0.0"
   barset:break
     color:production
     from:09/03/2021 till:18/05/2021 shift:(-13,$vshift) text:"3.1.0"
 bar:       
   color:production mark:(line,white) align:left fontsize:M
   from:22/09/2020 till:01/05/2022 shift:(-55,-4) text:"Ansible 2.10.0"
 bar:      
   color:production mark:(line,white) align:left fontsize:M
   from:31/10/2019 till:02/10/2021 shift:(-55,-4) text:"Ansible 2.9.0"
 bar:     
   color:production mark:(line,white) align:left fontsize:M
   from:16/05/2019 till:15/09/2019 shift:(-55,-4) text:"Ansible 2.8.0"
   barset:break
     color:production
     from:07/06/2019 till:04/07/2019 shift:(-13,$vshift) text:".1"
 bar:    
   color:production mark:(line,white) align:left fontsize:M
   from:04/10/2018 till:31/12/2018 shift:(-55,-4) text:"Ansible 2.7.0"
   barset:break
     color:production
     from:04/10/2018 till:16/05/2019 shift:(-13,$vshift) text:".0"
   barset:break
     color:production
     from:04/10/2018 till:16/05/2019 shift:(-13,$vshift) text:".1"
 bar:   
   color:production mark:(line,white) align:left fontsize:M
   from:02/07/2018 till:04/10/2018 shift:(-55,-4) text:"Ansible 2.6.0"
 bar:  
   color:production mark:(line,white) align:left fontsize:M
   from:23/03/2018 till:02/07/2018 shift:(-55,-4) text:"Ansible 2.5.0"
 bar: 
   color:production mark:(line,white) align:left fontsize:M
   from:18/09/2017 till:23/03/2018 shift:(-62,-4) text:"Ansible 2.4.0"

TextData =

  pos:(275,355)
  fontsize:L
  textcolor:black
  text:"Ansible timeline"

</timeline>

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).[13]

Sensitive data can be stored in encrypted files using Ansible Vault[14] since 2014.[15] In contrast with other popular configuration-management software — such as Chef, Puppet, Salt and CFEngine — Ansible uses an agentless architecture,[16] with Ansible software not normally running or even installed on the controlled node.[16] 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.[17] When Ansible is not managing a node, it does not consume resources on the node because no daemons are run or software installed.[16]

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.[18]

Control node

The control node (master host) is intended to manage (orchestrate) target machines (nodes termed as "inventory", see below).[19] 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.[20] Multiple control nodes are allowed.[19] Ansible does not require a single controlling machine for orchestration,[21] ensuring that disaster recovery is simple.[21] Nodes are managed by the controlling node over SSH.

Design goals

The design goals of Ansible include:[17]

  • Minimal in nature. Management systems should not impose additional dependencies on the environment.[16]
  • 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.[16][21]
  • Reliable. When carefully written, an Ansible playbook can be idempotent, to prevent unexpected side effects on the managed systems.[22] 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[23] are mostly standalone and can be written in a standard scripting language (such as Python, Perl, Ruby, Bash, etc.)Шаблон:Citation needed. 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.[17]Шаблон:Primary source inline

Inventory configuration

Location of target nodes is specified through inventory configuration lists (INI or YAML formatted) located at Шаблон:Code (on Linux).[13][24] 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.[13]

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,[25] and supports groups of groups.[26]

Playbooks

Playbooks are YAML files that store lists of tasks for repeated[27][19] executions on managed nodes.[19][28] Each Playbook maps (associates) a group of hosts to a set of roles. Each role is represented by calls to Ansible tasks.[29]

Ansible Automation Platform

Шаблон:Anchor 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 17+ upstream open source projects including the AWX upstream project (formerly Ansible Tower derived from), which has been open source since September 2017.[30][31][32][33]

There also is another open source alternative to Tower, Semaphore, written in Go.[34][35]

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[12]), and Python 2.7 or 3.5 is required.[18]

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.[36] Since version 1.7, Ansible can also manage Windows[37] nodes.[36] 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.[17]

AnsibleFest

AnsibleFest is an annual conference of the Ansible community of users, contributors, etc.[38]

Year Location
2014 San Francisco, California, US
2015 London, UK
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

See also

Шаблон:Portal

References

Шаблон:Reflist

External links

Шаблон:Red Hat Шаблон:Authority control