Ansible安装脚本

#!/bin/bash


yum -y installgcc zlib zlib-devel openssl sshpass libselinux libselinux-python wget;


cd/usr/local/src

wget -c https://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz

tarxvzf Python-2.7.8.tgz

cdPython-2.7.8

./configure--prefix=/usr/local

make&& makeinstall


cd/usr/local/include/python2.7

cp-a ./* /usr/local/include/


cd/usr/bin

mvpython python2.6

ln-s /usr/local/bin/python


sed-i "s/python/python2.7/"/usr/bin/yum

sed-i "s/python/python2.7/"/usr/libexec/urlgrabber-ext-down

sed-i "s/python/python2.7/"/usr/bin/repoquery



cd/usr/local/src

wget -c https://pypi.python.org/packages/source/s/setuptools/setuptools-7.0.tar.gz

tarxvzf setuptools-7.0.tar.gz

cdsetuptools-7.0

python setup.py install



cd/usr/local/src

wg

et https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz

tarxvzf pycrypto-2.6.1.tar.gz

cdpycrypto-2.6.1

python setup.py install


cd/usr/local/src

wget -c http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz

tarxvzf yaml-0.1.5.tar.gz

cdyaml-0.1.5

./configure--prefix=/usr/local

make

makeinstall



cd/usr/local/src

wget -c https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz

tarxvzf PyYAML-3.11.tar.gz

cdPyYAML-3.11

python setup.py install



cd/usr/local/src

wget -c https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.9.3.tar.gz

tarxvzf MarkupSafe-0.9.3.tar.gz

cdMarkupSafe-0.9.3

python setup.py install


cd/usr/local/src

wget -c https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz

tarxvzf Jinja2-2.7.3.tar.gz

cdJinja2-2.7.3

python setup.py install


cd/usr/local/src

wget https://pypi.python.org/packages/source/e/ecdsa/ecdsa-0.11.tar.gz

tarxvzf ecdsa-0.11.tar.gz

cdecdsa-0.11

python setup.py install



cd/usr/local/src

wget -c https://pypi.python.org/packages/source/p/paramiko/paramiko-1.15.1.tar.gz

tarxvzf paramiko-1.15.1.tar.gz

cdparamiko-1.15.1

python setup.py install



cd/usr/local/src

wget -c https://pypi.python.org/packages/source/s/simplejson/simplejson-3.6.5.tar.gz

tarxvzf simplejson-3.6.5.tar.gz

cdsimplejson-3.6.5

python setup.py install


cd/usr/local/src

wget -c https://github.com/ansible/ansible/archive/v1.7.2.tar.gz

tarxvzf v1.7.2.tar.gz

cdansible-1.7.2

python setup.py install


mkdir-p /etc/ansible

touch/etc/ansible/ansible.cfg

touch/etc/ansible/hosts

cat< /etc/ansible/ansible.cfg

[defaults]

inventory= /etc/ansible/hosts

sudo_user=root

remote_port=22

host_key_checking=False

remote_user=root

log_path=/var/log/ansible.log

module_name=command

#private_key_file=/usr/local/id_rsa_test

no_log:True

EOF



echo"done!"

你可能感兴趣的:(Ansible安装脚本)