Installation of Ansible

Source: Internet
Author: User

Ansible

Python-based Paramiko development, distributed, no client-side, lightweight, configuration syntax using Ymal and JINJA2

Template language, stronger remote command to perform operations


Ansible working mechanism

Ansible the Ansible module via the SSH protocol (or Kerberos, LDAP) on the management node

Line, automatically delete after execution, can use SVN to manage the custom module and orchestration


Five components

Ansible: Core

Modules: Core modules and custom modules

Plugins: Complete the module functions, including connection plug-ins, mail plugins, etc.

Playbooks: Many online translations for scripts, defining ansible Multi-tasking profiles, with ansible automatic execution

Inventory: Defining a checklist for ansible management hosts



Installing Ansible

RPM-IVH http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Installing the extension source

Yum-y Install Ansible


Set Ansible Trust

[Email protected]:~# Ssh-keygen

[Email protected]:~# ssh-copy-id-i ~/.ssh/id_rsa.pub [email protected]

[Email protected]:~# ssh-copy-id-i ~/.ssh/id_rsa.pub [email protected]


Basic module view with Ansible-doc-l view

Some modules are listed below

Copy

Ansible vm1-m copy-a ' Src=/root/aa dest=/root/'


650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/75/A0/wKiom1Y-yIiCoVd_AABHvtzTGSc825.png "style=" float: none; "title=" QQ picture 20151102125630.png "alt=" Wkiom1y-yiicovd_aabhvtztgsc825.png "/>


-M adds a module

-A is the parameter

VM1 is the group you defined in/etc/ansible/hosts

Ansible vm1-m yum-a "state=present name=httpd" install Apache service

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/75/9E/wKioL1Y-yM_QlR27AACpmNAEIPY351.png "title=" QQ picture 20151102130209.png "style=" Float:none; "alt=" Wkiol1y-ym_qlr27aacpmnaeipy351.png "/>


Ansible vm1-m service-a ' name=httpd state=started enabled=yes ' Start

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/75/9E/wKioL1Y-yMzwoexxAAAn3UBSSg0832.png "title=" QQ picture 20151102130257.png "style=" Float:none; "alt=" Wkiol1y-ymzwoexxaaan3ubssg0832.png "/>

Installation of Ansible

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.