Ansible automatic operation and maintenance (i.)

Source: Internet
Author: User

Ansible automatic operation and maintenance (i.)


I. Ansible automated operation and maintenance




Second, ansible installation


1. Basic Software Installation


(1) Installation python-2.7.8


CD python-2.7.8

./configure--prefix=/usr/local && make && make install

#如果ansible找不到python头文件的话, copy the Pytho header file to the standard directory

Cp-a/usr/local/include/python2.7/*/usr/local/include


#修改/usr/bin/yum

#!/usr/bin/python-#!/usr/bin/python2.6

#建立python2.7 Soft Links

Mv/usr/bin/python/usr/bin/python.bk

Ln-s/usr/local/bin/python2.7/usr/bin/python


(2) Installation setuptools-7.0


CD setuptools-7.0

Python setup.py Install


(3) Installation pycrypto-2.6.1


CD pycrypto-2.6.1

Python setup.py Install


(4) Installation PyYAML-3.11


CD PyYAML-3.11

Python setup.py Install


(5) Installation jinja2-2.7.3


CD jinja2-2.7.3

Python setup.py Install


(6) Installation paramiko-1.15.1


CD ecdsa-0.13

Python setup.py Install

CD paramiko-1.15.1

Python setup.py Install


(7) Installation simplejson-3.6.5


CD simplejson-3.6.5

Python setup.py Install


(8) Installation ansible-1.7.2


CD ansible-1.7.2

Python setup.py Install


2. Ansible Configuration



(1) SSH password-free login


#在所有机子执行

Ssh-key-geg-t Rsa-p '

#任意一台机子

Cp/root/.ssh/id_rsa.pub/root/.ssh/authorized_keys

chmod 600/root/.ssh/authorized_keys

#将其他机子的id_rsa. Pub append to Authorized_keys, and then transfer the file to/root/.ssh/

Scp/root/.ssh/authorized_keys [Email protected]:/root/.ssh/


#修改/etc/ssh/sshd_config, cancel the following comment and restart the sshd service

Rsaauthentication Yes

Pubkeyauthentication Yes

Authorizedkeysfile. Ssh/authorized_keys


#更改所有主机/etc/hosts

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/7E/A8/wKioL1cGdFeiypPrAARvBytMyqI310.png "/>


#设置完成后效果

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7E/AC/wKiom1cGc6ywBOqoAATpHjB3Ggg047.png "/>


#设置完成后效果, Master, Node1, Node2, node3 can ssh password-free login to each other

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/7E/A8/wKioL1cGdFqxw7j7AAHpxa8CTX4610.png "/>

This article is from the "Love On Action" blog, please be sure to keep this source http://1055745601.blog.51cto.com/5003160/1761536

Ansible automatic operation and maintenance (i.)

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.