Ansible basic introduction

Foreword

2020 February 23 at night, pain free eggs, thinking tidy ansible review it. . .

 

Tools Introduction

Ansible operation and maintenance is an automated tool designed to reduce human error, improve automation and efficiency of operations. Commonly used for software deployment automation, automated provisioning, automated management, systematic task for inheritance, smooth upgrade and so on. Founder Michael DeHaan.

 

Data access

Official address: https: //www.ansible.com/

The official document: https: //docs.ansible.com/

Chinese document: http: //www.ansible.com.cn/

Code repository: https: //github.com/ansible/ansible

Blueprint version: https: //docs.ansible.com/ansible/latest/roadmap/index.html (2.0 the previous version, but have been eliminated, most of the original version is version 0.0.1, released March 9, 2012 day)

 

The same type of tool

Chef、Fabric、Puppet、SaltStack

 

Ansible advantage

  • Ansible are using python for development
  • Ansible contains a wealth of built-in modules, and continuous update
  • Ansible idea of ​​using decentralized to go, that does not require client

 

Ansible works

Ansible tool by calling various built-in application modules will push the instruction execution means the management side, and automatically delete temporary files generated after the execution is complete. Ansible there depending on different end systems management is dependent, dependent on the ssh protocol under Linux, Windows, rely on PowerShell. Ansible need its own secret key to upload to the secret key verification file management side of or communicate via user passwords are managed end; official recommended the previous way operation, first password authentication is not secure, followed by the secret key authentication more convenient (this latter point is only personal opinion ha, if different views directly to filter out of it).

 

Use

  • CMDB: through the database in conjunction with Ansible, issued a directive calling Ansible complete toolset purpose of the user want to reach through direct CMDB (I have not used this way, to be studied)
  • API: Ansible addition to a wealth of built-in modules, while the official website also provide a lot of API, can be secondary development. (This I will not ...)
  • Ad-hoc: command set, similar to the preliminary order. In fact, official website call this approach a provisional order, similar to the following pseudo-terminal linux operating command.
  • Playbook: predefined instruction set, similar to the following linux shell document. Define the contents of the file to yaml, yml, ini format.

 

Toolset

Toolset i.e. Ansible workflow tools involved.

  • Ad-hoc: the above said, the temporary command.
  • INVENTORY: definition file with the host group, the definition contents are: host name, IP address, host group, the variables.
  • API: Application Programming Interface
  • Modules: built-in module
  • Plugins: built-in or custom plug-in

PS : The above tools Playbook only documents containing the content or calls to achieve its purpose, it is not a tool.

 

Role of the object

  • Linux host operating
  • Windows operating host (Windows hosts only be action, not for master management)
  • Private cloud, such as: openstack, vmware
  • Public cloud, such as: azure
  • Container technology, such as: docker
  • Choreography techniques, such as: k8s

The above is only a partial list, I looked rough latest ansible-doc (ansible is a built-in module), there are 3387, just getting started with this technology when it looks like only about 500, up more than 2 years in this way, it is really exaggerated

 

Ansible history of communication development

  • Paremiko: initial implementation python library, the pace of development of communication Ansible far and OpenSSH. Use only in RHEL5 / 6 versions
  • OpenSSH: The default communication Ansible1.3 version to start using. Using ControlPersist function, faster and more reliable than Paremiko
  • Acceleration mode: the communication speed has greatly improved, compared with the former two are an exponential growth, it does not seem very friendly to Ad-hoc.

 

Ansible scenarios

  • Application deployment
  • Configuration Management
  • Task flow arrangement

Guess you like

Origin www.cnblogs.com/guge-94/p/12346597.html