Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction of ansible Automation Operation and maintenance tool

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The knowledge points of this article include: the concept of ansible, the principle of ansible and the modules included in ansible. Reading the complete article, I believe you have a certain understanding of ansible tools.

What is ansible?

Ansible is a new automatic operation and maintenance tool. Based on Python development, it integrates the advantages of many operation and maintenance tools (puppet, cfengine, chef, func, fabric), and realizes the functions of batch system configuration, batch program deployment, batch running commands and so on. Ansible works based on modules and does not have the ability to deploy in batches. What really has batch deployment is the module that ansible runs, and ansible only provides a framework. It mainly includes:

(1) connection plug-in connection plugins: responsible for communicating with the monitored end

(2), host inventory: specify the host for operation, which is the host for monitoring defined in the configuration file.

(3) various modules core module, command module, custom module

(4) with the help of plug-ins, log mail and other functions are completed.

(5), playbook: when the script performs multiple tasks, it is not necessary to let the node run multiple tasks at one time.

Ansible feature 1. Deployment is simple, only need to deploy the Ansible environment in the main control side, the controlled side does not need to do any operation; 2. SSH protocol is used by default to manage the device; 3. There are a large number of routine operation and maintenance operation modules, which can realize most of the daily operations; 4. Simple configuration, powerful function and strong expansibility; 5. Support API and custom modules, can be easily extended through Python; 6. Through Playbooks to customize the powerful configuration, state management; 7. Lightweight, do not need to install agent in the client, update, only need to update once on the operator; 8. Idempotency, the effect of one or n times of a task is the same, Ansible architecture and working principle are not caused by repeated execution.

Ansible:Ansible core program. HostInventory: records host information managed by Ansible, including port, password, ip, etc. Playbooks: "script" YAML format file, where multiple tasks are defined in one file, defining which modules the host needs to call to complete the function. CoreModules: core module, the main operation is to call the core module to complete the management task. CustomModules: custom module, complete the core module can not complete the function, support multiple languages. ConnectionPlugins: connection plug-in, Ansible and Host communication using ansible task execution mode

The operation mode of the managed node by the control host in the Ansible system can be divided into two types, namely adhoc and playbook:

Ad-hoc mode (point-to-point mode) uses a single module and supports batch execution of a single command. The ad-hoc command is a command that can be entered quickly and does not need to be saved. It is equivalent to a word shell in bash. Playbook mode (script mode) is not only the main management mode of Ansible, but also the key to the powerful function of Ansible. Playbook completes a class of functions through multiple task collections, such as the installation and deployment of Web services, batch backups of database servers, and so on. You can simply think of playbook as a configuration file by combining multiple ad-hoc operations. Ansible execution process

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report