Linux 下编译安装 ansible

文章
林里克斯

Linux 下编译安装 ansible


实验平台:CentOS Linux release 7.6.1810

ansible version: ansible 2.9.9


1.官网

https://releases.ansible.com/ansible/
https://github.com/ansible/ansible

2.安装依赖

$ yum -y install gcc gcc-c++ python-devel make wget unzip

3.安装依赖模块

- setuptools
$ wget https://files.pythonhosted.org/packages/37/1b/b25507861991beeade31473868463dad0e58b1978c209de27384ae541b0b/setuptools-40.6.3.zip
$ unzip setuptools-40.6.3.zip
$ cd setuptools-51.0.0
$ python setup.py install
- pycrypto
$ wget https://pypi.python.org/packages/source/p/pycrypto/pycrypto-2.6.1.tar.gz
$ tar xf pycrypto-2.6.1.tar.gz
$ cd pycrypto-2.6.1
$ python setup.py install
- PyYAML
$ wget https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz
$ tar xf PyYAML-3.11.tar.gz
$ cd PyYAML-3.11
$ python setup.py install
- MarkupSafe (Jinja依赖)
$ wget https://pypi.python.org/packages/source/M/MarkupSafe/MarkupSafe-0.9.3.tar.gz
$ tar xf MarkupSafe-0.9.3.tar.gz
$ cd MarkupSafe-0.9.3
$ python setup.py install
- Jinja2
$ wget https://pypi.python.org/packages/source/J/Jinja2/Jinja2-2.7.3.tar.gz
$ Jinja2-2.7.3.tar.gz
$ cd Jinja2-2.7.3
$ python setup.py install

4.编译安装 ansible

$ wget https://releases.ansible.com/ansible/ansible-latest.tar.gz
$ tar xf ansible-latest.tar.gz 
$ cd ansible-2.9.13/
$ python setup.py install

5.验证

$ ansible --version
/usr/lib/python2.7/site-packages/ansible-2.9.9-py2.7.egg/ansible/parsing/vault/__init__.py:44: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in the next release.
  from cryptography.exceptions import InvalidSignature
ansible 2.9.9
  config file = None
  configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/site-packages/ansible-2.9.9-py2.7.egg/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.5 (default, Nov 16 2020, 22:23:17) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] 
#表示 ansible 最新已在渐渐不支持 python2 ,建议将其升级为 Python3

后续升级下相应版本

Over~

版权协议须知!

本篇文章来源于 Uambiguous ,如本文章侵犯到任何版权问题,请立即告知本站,本站将及时予与删除并致以最深的歉意

1574 0 2020-12-15


分享:
icon_mrgreen.gificon_neutral.gificon_twisted.gificon_arrow.gificon_eek.gificon_smile.gificon_confused.gificon_cool.gificon_evil.gificon_biggrin.gificon_idea.gificon_redface.gificon_razz.gificon_rolleyes.gificon_wink.gificon_cry.gificon_surprised.gificon_lol.gificon_mad.gificon_sad.gificon_exclaim.gificon_question.gif
博主卡片
林里克斯 博主大人
一个致力于Linux的运维平台
运维时间
搭建这个平台,只为分享及记载自己所遇之事和难题。

现在时间 2024-12-28

今日天气
站点统计
  • 文章总数:241篇
  • 分类总数:29个
  • 评论总数:12条
  • 本站总访问量 353171 次

@奥奥

@Wong arrhenius 牛比

@MakerFace 厉害了!