centos ansibleインストール構成
ansibleについてはあまり簡単に説明しないで、直接インストール構成を開始します
【設置環境】
OS依存パッケージのインストール
libyamlをダウンロードしてインストール
python依存パッケージをダウンロードしてインストール
ansibleをダウンロードしてインストール
次に、AnsibleServer接続Nod 1を構成します.
SSH鍵信頼を設定するには、もちろんansiblesもパスワードでログインできます
構成ansible
質問レコード:
[root@AnsibleServer ~]# ansible test -m ping
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
NOD1 | SUCCESS => {
"changed": false,
"ping": "pong"
}
システムがgmpライブラリを持っているバージョンが低すぎて、gmp 5にアップグレードする必要があるという意味です.x
以下の方法で処理する
以上がcentos ansibleインストール構成です.次の節ではansible-playbookを構成します.
【設置環境】
[root@AnsibleServer ~]# cat /etc/centos-release
CentOS release 6.5 (Final)
[root@AnsibleServer ~]# uname -a
Linux AnsibleServer 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
OS依存パッケージのインストール
[root@AnsibleServer ~]#yum install -y python-setuptools python-devel gmp-devel gcc java-1.7.0-openjdk unzip svnkit
libyamlをダウンロードしてインストール
[root@AnsibleServer ~]#wget http://pyyaml.org/download/libyaml/yaml-0.1.5.tar.gz
[root@AnsibleServer ~]#tar -zxvf yaml-0.1.5.tar.gz
[root@AnsibleServer ~]#cd yaml-0.1.5
[root@AnsibleServer yaml-0.1.5]#./configure
[root@AnsibleServer yaml-0.1.5]#make
[root@AnsibleServer yaml-0.1.5]#make install
python依存パッケージをダウンロードしてインストール
[root@AnsibleServer ~]#wget https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.23.tar.gz
[root@AnsibleServer ~]#tar -zxvf MarkupSafe-0.23.tar.gz
[root@AnsibleServer ~]#cd MarkupSafe-0.23
[root@AnsibleServer MarkupSafe-0.23]#python setup.py install
[root@AnsibleServer ~]#https://pypi.python.org/packages/source/p/paramiko/paramiko-1.15.2.tar.gz
[root@AnsibleServer ~]#https://pypi.python.org/packages/source/e/ecdsa/ecdsa-0.13.tar.gz
[root@AnsibleServer ~]#https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz
[root@AnsibleServer ~]#https://pypi.python.org/packages/source/D/Distutils2/Distutils2-1.0a4.tar.gz
[root@AnsibleServer ~]#https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz
[root@AnsibleServer ~]#https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.8.tar.gz
ansibleをダウンロードしてインストール
[root@AnsibleServer ~]#wget https://github.com/ansible/ansible/releases/download/v2.0.0.1-1/ansible-2.0.0.1.tar.gz
https://github.com/ansible/ansible
[root@AnsibleServer ~]#tar -zxvf ansible-2.0.0.1.tar.gz
[root@AnsibleServer ~]#python setup.py install
[root@AnsibleServer ~]#mkdir -p /etc/ansible
[root@AnsibleServer ~]#cp -rp examples/* /etc/ansible/
3 , , ansible !
ansible
ansible-playbook
ansible-doc
: 1.8 , ( ansible ,
( github )
,
[root@AnsibleServer modules]# cd /usr/lib/python2.6/site-packages/ansible-2.0.0.1-py2.6.egg/ansible/modules
[root@AnsibleServer modules]# ls
core extras __init__.py __init__.pyc
core extras ,
[root@AnsibleServer modules]#git clone https://github.com/ansible/ansible-modules-core/tree/stable-2.0.0.1 core
[root@AnsibleServer modules]#git clone https://github.com/ansible/ansible-modules-extras/tree/stable-2.0.0.1 extras
次に、AnsibleServer接続Nod 1を構成します.
SSH鍵信頼を設定するには、もちろんansiblesもパスワードでログインできます
/etc/hosts
[root@AnsibleServer ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.81.129 NOD1
SSH
[root@AnsibleServer ~]# ssh-keygen -t rsa
[root@AnsibleServer ~]# ssh-copy-id -i ~/.ssh/id_rsa root@nod1
[root@AnsibleServer ~]# ssh nod1
Last login: Fri Mar 25 18:07:17 2016 from 192.168.81.128
[root@NOD1 ~]# exit
構成ansible
[root@AnsibleServer ~]# vi /etc/ansible/hosts
[test]
NOD1
[root@AnsibleServer ansible]# ansible test -m ping
NOD1 | SUCCESS => {
"changed": false,
"ping": "pong"
}
質問レコード:
[root@AnsibleServer ~]# ansible test -m ping
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
NOD1 | SUCCESS => {
"changed": false,
"ping": "pong"
}
システムがgmpライブラリを持っているバージョンが低すぎて、gmp 5にアップグレードする必要があるという意味です.x
以下の方法で処理する
1、 http://ftp.gnu.org/gnu/gmp/
#cd /tmp
#wget http://ftp.gnu.org/gnu/gmp/gmp-5.1.3.tar.bz2
#tar xjvf gmp-5.1.3.tar.bz2
#cd gmp-5.1.3
#./configure
#make
#make install
4、 ldconfig
#echo "/usr/local/lib" >> /etc/ld.so.conf.d/gmp.conf
#ldconfig
5、
#strings /etc/ld.so.cache|grep gmp
libgmpxx.so.4
/usr/lib64/libgmpxx.so.4
libgmp.so.10
/usr/local/lib/libgmp.so.10
libgmp.so.3
/usr/lib64/libgmp.so.3
libgmp.so
/usr/local/lib/libgmp.so
6、 pycrypto
pip
#wget --no-check-certificate https://github.com/pypa/pip/archive/1.5.5.tar.gz
#tar zvxf 1.5.5.tar.gz #
#cd pip-1.5.5/
#python setup.py install
pip pycrypto
#pip uninstall pycrypto
#pip install pycrypto
。
# ansible test -m ping
NOD1 | SUCCESS => {
"changed": false,
"ping": "pong"
}
以上がcentos ansibleインストール構成です.次の節ではansible-playbookを構成します.