Ansible is an open-source software platform for configuring and managing compute and switching infrastructure using playbooks. It was created in 2012 as an alternative to Puppet and Chef. Ansible was later acquired by Red Hat in 2015. Ansible features a state-driven resource model that describes the desired state of computer systems and services. It is used to automate the configuration of a company’s compute and switching resources in an agentless manner. Another notable difference between Puppet, Chef, Terraform, and Ansible is that Ansible is written in Python. It also uses YAML as a language to write Playbooks, resulting in human readable scripts.
Ansible 是一套開放原始碼軟體平台,使用 playbook(劇本)來設定與管理運算及交換基礎架構。它於 2012 年推出,作為 Puppet 和 Chef 的替代方案。Ansible 後來在 2015 年被 Red Hat 收購。Ansible 具有狀態驅動的資源模型,描述電腦系統與服務的期望狀態。它以無代理程式(agentless)的方式,用來自動化公司運算與交換資源的設定。Puppet、Chef、Terraform 與 Ansible 之間另一個顯著差異是,Ansible 以 Python 撰寫。它也使用 YAML 作為撰寫 Playbook 的語言,讓腳本易於閱讀。
Being natively agentless significantly lowers the barrier to entry from an automation perspective. Since Ansible is agentless, it can integrate and automate any device using any API. For example, integrations can use REST APIs, NETCONF, SSH, or even SNMP, if desired.
原生無代理程式的特性大幅降低了自動化導入的門檻。由於 Ansible 是無代理程式的,因此可以整合並自動化使用任何 API 的任何裝置。舉例來說,整合可使用 REST API、NETCONF、SSH,甚至 SNMP,視需求而定。
A network or DevOps engineer typically defines a playbook with the desired state of the target device on the Ansible controller. The Ansible controller then establishes a connection (usually SSH, but other plugins can be used) to a target and compares the current state of resources on a target with the desired state as defined in the playbook. If a change is needed, the controller executes the playbook and then notifies the administrator of the changed or unchanged state of the device.
網路或 DevOps 工程師通常會在 Ansible 控制器上定義一份 playbook,描述目標裝置的期望狀態。Ansible 控制器接著會建立與目標的連線(通常是 SSH,但也可使用其他外掛),並比較目標上資源的目前狀態與 playbook 中定義的期望狀態。如果需要變更,控制器會執行該 playbook,然後通知管理員該裝置狀態是否已變更。

