SUSE12 sp1安装ansible2.8

SUSE12没法直接安装ansible,目前有两种办法:一是pip编译安装;一是docker实现ansible。今天简单总结编译安装:

环境

SUSE Linux Enterprise Server 12 (x86_64)
VERSION = 12
PATCHLEVEL = 1

安装setup-tools

http://distfiles.macports.org/py-setuptools/ 下载setuptools-41.0.0.zip

#unzip setuptools-41.0.0.zip
#cd setuptools-41.0.0
#chmod +x -R ./
#./setup.py install

此时会安装easy-install工具

安装pip


#easy-install pip

Searching for pip
Reading https://pypi.org/simple/pip/
Downloading https://files.pythonhosted.org/packages/62/ca/94d32a6516ed197a491d17d46595ce58a83cbb2fca280414e57cd86b84dc/pip-19.2.1-py2.py3-none-any.whl#sha256=80d7452630a67c1e7763b5f0a515690f2c1e9ad06dda48e0ae85b7fdf2f59d97
Best match: pip 19.2.1
Processing pip-19.2.1-py2.py3-none-any.whl
Installing pip-19.2.1-py2.py3-none-any.whl to /usr/lib/python2.7/site-packages
Adding pip 19.2.1 to easy-install.pth file
Installing pip script to /usr/bin
Installing pip3.7 script to /usr/bin
Installing pip3 script to /usr/bin
Installed /usr/lib/python2.7/site-packages/pip-19.2.1-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip

安装ansible


#pip install ansible
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting ansible
  Downloading https://files.pythonhosted.org/packages/1f/eb/bdc25ca4d1918a2fb914de188b28374825f415643c69aa108d557203b901/ansible-2.8.3.tar.gz (14.3MB)
     |████████████████████████████████| 14.3MB 8.4kB/s
Collecting jinja2 (from ansible)
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)",)': /simple/jinja2/
  Downloading https://files.pythonhosted.org/packages/1d/e7/fd8b501e7a6dfe492a433deb7b9d833d39ca74916fa8bc63dd1a4947a671/Jinja2-2.10.1-py2.py3-none-any.whl (124kB)
     |████████████████████████████████| 133kB 11kB/s 
Collecting PyYAML (from ansible)
  Downloading https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz (265kB)
     |████████████████████████████████| 266kB 8.5kB/s 
Requirement already satisfied: cryptography in /usr/lib64/python2.7/site-packages (from ansible) (1.0)
Collecting MarkupSafe>=0.23 (from jinja2->ansible)
  Downloading https://files.pythonhosted.org/packages/fb/40/f3adb7cf24a8012813c5edb20329eb22d5d8e2a0ecf73d21d6b85865da11/MarkupSafe-1.1.1-cp27-cp27mu-manylinux1_x86_64.whl
Requirement already satisfied: idna>=2.0 in /usr/lib/python2.7/site-packages (from cryptography->ansible) (2.0)
Requirement already satisfied: pyasn1>=0.1.8 in /usr/lib/python2.7/site-packages (from cryptography->ansible) (0.1.8)
Requirement already satisfied: six>=1.4.1 in /usr/lib/python2.7/site-packages (from cryptography->ansible) (1.9.0)
Requirement already satisfied: setuptools in /usr/lib/python2.7/site-packages/setuptools-41.0.0-py2.7.egg (from cryptography->ansible) (41.0.0)
Requirement already satisfied: enum34 in /usr/lib/python2.7/site-packages (from cryptography->ansible) (1.0)
Requirement already satisfied: ipaddress in /usr/lib/python2.7/site-packages (from cryptography->ansible) (1.0.14)
Requirement already satisfied: cffi>=1.1.0 in /usr/lib64/python2.7/site-packages (from cryptography->ansible) (1.1.0)
Requirement already satisfied: pycparser in /usr/lib/python2.7/site-packages (from cffi>=1.1.0->cryptography->ansible) (2.10)
Installing collected packages: MarkupSafe, jinja2, PyYAML, ansible
  Running setup.py install for PyYAML ... done
  Running setup.py install for ansible ... done
Successfully installed MarkupSafe-1.1.1 PyYAML-5.1.2 ansible-2.8.3 jinja2-2.10.1

测试结果


linux-xd4m:~/.ssh # ansible test -i inventory -m ping
 [WARNING]: Platform linux on host 192.168.101.101 is using the discovered Python interpreter at /usr/bin/python, but future
installation of another Python interpreter could change this. See
https://docs.ansible.com/ansible/2.8/reference_appendices/interpreter_discovery.html for more information.

192.168.101.101 | SUCCESS => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python"
    }, 
    "changed": false, 
    "ping": "pong"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值