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