ansible-playbook安装在哪个目录
1个回答
2017-01-09
展开全部
pip2.6安装Ansible,但是pip2.6是基于python2.6安装的,而python2.6版本有点老。所以而已用python2.7安装Ansible。
其实python2.7安装Ansible和python2.6安装过程基本上是一样的,只不过在安装Ansible所需要的模块和Ansible时,需要用pip2.7来安装。
安装过程如下:
1、安装python2.7
安装python2.7前的准备
yum-yinstallreadlinereadline-devel
yum-yinstallzlib-devel
yum-yinstallopensslopenssl-devel
安装gcc编译工具
yum-yinstallgcc
下载python2.7安装包
下载地址:www python.org
yum-yinstallxz
tarJxfPython-2.7.11.tar.xz
cdPython-2.7.11
mkdir/usr/local/python27
./configure--prefix=/usr/local/python27
make&&makeinstall
创建软连接
ln-s/usr/local/python27/bin/python2.7/usr/bin/python2.7
2、安装pip2.7
安装setuptools
下载地址:https//pypi.python.org/pypi?%3Aaction=search&term=setuptools&submit=search
安装:
tarzxfsetuptools-19.6.2.tar.gz
cdsetuptools-19.6.2
python2.7setup.pyinstall
安装pip
下载地址:https//pypi.python.org/pypi/pip/
安装:
tarzxfpip-8.1.0.tar.gz
cdpip-8.1.0
python2.7setup.pyinstall
创建软连接
ln-s/usr/local/python27/bin/pip2.7/usr/bin/pip2.7
3、安装Ansible
安装依赖包
yum-yinstalllibffilibffi-devel
yum-yinstallgccgcc-c++python-develpython-simplejson
安装Ansible需要的python模块
pip2.7installparamikoPyYAMLJinja2httplib2six
安装Ansible
pipinstallansible
安装完成后,ansible的执行文件在python2.7的bin目录下
[root@localhostbin]#cd/usr/local/python27/bin/
[root@localhostbin]#ll
total6240
-rwxr-xr-x.1rootroot110Jun1517:312to3
-rwxr-xr-x.1rootroot4203Jun1517:48ansible
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-console
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-doc
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-galaxy
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-playbook
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-pull
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-vault
-rwxr-xr-x.1rootroot326Jun1517:41easy_install
-rwxr-xr-x.1rootroot334Jun1517:41easy_install-2.7
-rwxr-xr-x.1rootroot108Jun1517:31idle
-rwxr-xr-x.1rootroot284Jun1517:42pip
-rwxr-xr-x.1rootroot286Jun1517:42pip2
-rwxr-xr-x.1rootroot290Jun1517:42pip2.7
-rwxr-xr-x.1rootroot93Jun1517:31pydoc
lrwxrwxrwx.1rootroot7Jun1517:33python->python2
lrwxrwxrwx.1rootroot9Jun1517:33python2->python2.7
-rwxr-xr-x.1rootroot6271354Jun1517:31python2.7
-rwxr-xr-x.1rootroot1696Jun1517:33python2.7-config
lrwxrwxrwx.1rootroot16Jun1517:33python2-config->python2.7-config
lrwxrwxrwx.1rootroot14Jun1517:33python-config->python2-config
-rwxr-xr-x.1rootroot18556Jun1517:31smtpd.py
编辑/etc/profile文件,加入以下配置
exportANSIBLE_HOME=/usr/local/python27
exportPATH=$PATH:$ANSIBLE_HOME/bin[root@localhostbin]#ansible--version
ansible2.1.0.0
configfile=
configuredmodulesearchpath=Defaultw/ooverrides
其实python2.7安装Ansible和python2.6安装过程基本上是一样的,只不过在安装Ansible所需要的模块和Ansible时,需要用pip2.7来安装。
安装过程如下:
1、安装python2.7
安装python2.7前的准备
yum-yinstallreadlinereadline-devel
yum-yinstallzlib-devel
yum-yinstallopensslopenssl-devel
安装gcc编译工具
yum-yinstallgcc
下载python2.7安装包
下载地址:www python.org
yum-yinstallxz
tarJxfPython-2.7.11.tar.xz
cdPython-2.7.11
mkdir/usr/local/python27
./configure--prefix=/usr/local/python27
make&&makeinstall
创建软连接
ln-s/usr/local/python27/bin/python2.7/usr/bin/python2.7
2、安装pip2.7
安装setuptools
下载地址:https//pypi.python.org/pypi?%3Aaction=search&term=setuptools&submit=search
安装:
tarzxfsetuptools-19.6.2.tar.gz
cdsetuptools-19.6.2
python2.7setup.pyinstall
安装pip
下载地址:https//pypi.python.org/pypi/pip/
安装:
tarzxfpip-8.1.0.tar.gz
cdpip-8.1.0
python2.7setup.pyinstall
创建软连接
ln-s/usr/local/python27/bin/pip2.7/usr/bin/pip2.7
3、安装Ansible
安装依赖包
yum-yinstalllibffilibffi-devel
yum-yinstallgccgcc-c++python-develpython-simplejson
安装Ansible需要的python模块
pip2.7installparamikoPyYAMLJinja2httplib2six
安装Ansible
pipinstallansible
安装完成后,ansible的执行文件在python2.7的bin目录下
[root@localhostbin]#cd/usr/local/python27/bin/
[root@localhostbin]#ll
total6240
-rwxr-xr-x.1rootroot110Jun1517:312to3
-rwxr-xr-x.1rootroot4203Jun1517:48ansible
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-console
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-doc
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-galaxy
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-playbook
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-pull
-rwxr-xr-x.1rootroot4203Jun1517:48ansible-vault
-rwxr-xr-x.1rootroot326Jun1517:41easy_install
-rwxr-xr-x.1rootroot334Jun1517:41easy_install-2.7
-rwxr-xr-x.1rootroot108Jun1517:31idle
-rwxr-xr-x.1rootroot284Jun1517:42pip
-rwxr-xr-x.1rootroot286Jun1517:42pip2
-rwxr-xr-x.1rootroot290Jun1517:42pip2.7
-rwxr-xr-x.1rootroot93Jun1517:31pydoc
lrwxrwxrwx.1rootroot7Jun1517:33python->python2
lrwxrwxrwx.1rootroot9Jun1517:33python2->python2.7
-rwxr-xr-x.1rootroot6271354Jun1517:31python2.7
-rwxr-xr-x.1rootroot1696Jun1517:33python2.7-config
lrwxrwxrwx.1rootroot16Jun1517:33python2-config->python2.7-config
lrwxrwxrwx.1rootroot14Jun1517:33python-config->python2-config
-rwxr-xr-x.1rootroot18556Jun1517:31smtpd.py
编辑/etc/profile文件,加入以下配置
exportANSIBLE_HOME=/usr/local/python27
exportPATH=$PATH:$ANSIBLE_HOME/bin[root@localhostbin]#ansible--version
ansible2.1.0.0
configfile=
configuredmodulesearchpath=Defaultw/ooverrides
快又稳
2024-10-28 广告
2024-10-28 广告
在Linux环境下配置基于域名的虚拟主机,需安装Apache或Nginx等Web服务器,并编辑配置文件。以Apache为例,需创建虚拟主机配置文件,指定域名、文档根目录等,然后启用该配置文件并重启Apache服务。同样,Nginx也需在相应...
点击进入详情页
本回答由快又稳提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询