Skip to content

Commit

Permalink
ansible
Browse files Browse the repository at this point in the history
  • Loading branch information
ppabc committed Jul 7, 2016
1 parent 1bdcf19 commit 4b5f0e2
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion ansible/ansible.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@

#安装Ansible,安装EPEL第三方yum源
rpm -Uvh epel-release-6-8.noarch.rpm
yum install -y gcc python-devel python-pip libffi-devel libxml2 openssl openssl-devel python-requests python-setuptools python-tornado python-simplejson PyYAML libyaml python-babel python-crypto python-crypto2.6 python-httplib2 python-jinja2-26 python-keyczar python-markupsafe python-paramiko python-pyasn1 python-jinja2 sshpass ansible
yum install -y gcc python-devel python-pip libffi-devel libxml2 openssl openssl-devel python-requests python-setuptools python-tornado python-simplejson PyYAML libyaml python-babel python-crypto python-crypto2.6 python-httplib2 python-jinja2-26 libselinux-python python-keyczar python-markupsafe python-paramiko python-pyasn1 python-jinja2 sshpass ansible

##安装ansible另一方法
##wget https://pypi.python.org/packages/source/a/ansible/ansible-2.1.0.0.tar.gz
##wget https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.2.tar.gz
##tar zxvf setuptools-19.6.2.tar.gz
##cd setuptools-19.6.2
##python setup.py install
##cd ..
##tar zxvf ansible-2.1.0.0.tar.gz
##cd ansible-2.1.0.0
##python setup.py build
##python setup.py install
##ansible --version


##添加环境变量以便vi能正常显示中文注释.
Expand Down Expand Up @@ -40,6 +53,11 @@ chmod 600 ~/.ssh/authorized_keys
ssh-copy-id -i /root/.ssh/id_dsa.pub [email protected]
ssh-copy-id -i /root/.ssh/id_dsa.pub [email protected]

#ssh无密码认证 RSA
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

#注意文件是id_dsa.pub还是id_rsa.pub,否则会出现ssh-copy-id: ERROR: No identities found
ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected]
ssh-copy-id -i /root/.ssh/id_rsa.pub [email protected]
Expand Down

0 comments on commit 4b5f0e2

Please sign in to comment.