Automation Maintenance Tool Ansible Introduction (1)

Source: Internet
Author: User

Ansible


The automated operation and maintenance system is divided into 3 structures

Install operating system: OS provision

Representative Product: Pxe,cobbler

To install a specific file: OS Config

Representative Product: Puppet

To perform a specific action (command): Deployment

Representative Product: Ansible



Ansible General Framework Diagram:


650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/8A/E2/wKiom1g-KFrDGdwWAAJgLrRJMHY747.png "title=" Ansible.png "alt=" Wkiom1g-kfrdgdwwaajglrrjmhy747.png "/>



Ansible Introduction

1. Based on module work, Ansible is just a framework

2. The use of plug-ins to complete the logging of mail functions;

3. Connection plug-in connection plugins: responsible for and be monitored to achieve communication;

4.host Inventory: Specifies the operation of the host, is a configuration file inside the definition of monitoring host;

5.playbook: When a script performs multiple tasks, it is not necessary to have the node run multiple tasks at once.

6 Module Core module, command module, custom module;


Ansible Features:

1. No need to be managed to install any agent on the host

2. Do not need the server side, directly run the command can

3. Based on module work, third-party modules can be used

4. SSH-based work

5. Customizing scripts using Yaml language



Basic preparatory work

1. Time to synchronize

2. Host to each other




Simple Use Example


node1:192.168.0.106 centos7.2

node2:192.168.0.110 centos7.2


[[email protected] ~]# yum-y install ansible--with Yum installation Ansible[[email protected] ~]# rpm-q ansible ansible-2.2.0.0 -3.el7.noarch--Version ansible-2.2


[[email protected] ~]# RPM-QL ansible-A simple view of the generated file list/etc/ansible/etc/ansible/ansible.cfg/etc/ansible/hosts/etc/ Ansible/roles/usr/bin/ansible/usr/bin/ansible-doc/usr/bin/ansible-playbook


[Email protected] ~]# vim/etc/ansible/hosts---Define host inventory[all]192.168.0.106192.168.0.110


[[email protected] ~]# ansible all-m ping-Test management host OK192.168.0.106 | SUCCESS + = {"Changed": false, "ping": "Pong"--Represents normal}192.168.0.110 | SUCCESS + = {"Changed": false, "ping": "Pong"--means normal}


650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/8A/E2/wKiom1g-KOrQvIhiAAAU9tD-I4g622.png-wh_500x0-wm_3 -wmp_4-s_1706912901.png "title=" Ansible2.png "alt=" Wkiom1g-korqvihiaaau9td-i4g622.png-wh_50 "/>


Simple command using Help # ansible 


Automation Maintenance Tool Ansible Introduction (1)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.