ansible的源码安装:
1. 使用源码安装python3.6
[root@python ~]# yum -y install gcc gcc-c++ ncurses ncurses-devel unzip zlib-devel zlib openssl-devel openssl
[root@python ~]# cd /usr/local/src/
[root@python ~]# wget 'https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz'
[root@python ~]# tar -zxvf Python-3.6.4.tgz
[root@python ~]# cd Python-3.6.4/
[root@python Python-3.6.4]# ./configure –prefix=/usr/local/python/
[root@python Python-3.6.4]# make
[root@python Python-3.6.4]# make install
2. 测试python3是否安装成功
[root@python Python-3.6.4]# /usr/local/python/bin/python3 --version
Python 3.6.4
[root@python Python-3.6.4]# ln -s /usr/local/python/bin/python3 /usr/local/bin/
[root@python Python-3.6.4]# python3 --version
Python 3.6.4
升级pip
[root@python bin]# /usr/local/python/bin/pip3 install --upgrade pip
3. 安装ansible最新版本
[root@python bin]# /usr/local/python/bin/pip3 install ansible
[root@python bin]# ./ansible --version
ansible 2.7.10
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible