各种系统下包安装+pip安装Ansible

1.包安装

  • centos系统

#epel源的rpm包安装

[root@centos ~]#yum -y install ansible

  • ubuntu系统

root@ubuntu ~]#apt -y install ansible

  • rocky系统

#包安装存在依赖问题无法实现

[root@rocky8 ~]#yum -y install ansible

Error: Problem: conflicting requests  - nothing provides python3.9dist(ansible-core) needed by ansible-6.3.0- 1.el8.noarch  - nothing provides (python3.9dist(ansible-core) >= 2.13.3 with python3.9dist(ansible-core) < 2.14) needed by ansible-6.3.0-1.el8.noarch (try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

 

2.pip安装

  • rocky系统

[root@rocky8 ~]#yum -y install python39 rust

[root@rocky8 ~]#pip3 install --upgrade pip -i https://pypi.douban.com/simple

[root@rocky8 ~]#pip3 install ansible -i https://pypi.douban.com/simple/

[root@rocky8 ~]#ansible --version

ansible [core 2.14.1] config file = None configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules'] ansible python module location = /usr/local/lib/python3.9/sitepackages/ansible ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections executable location = /usr/local/bin/ansible python version = 3.9.6 (default, Nov  9 2021, 13:31:27) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)] (/usr/bin/python3.9) jinja version = 3.1.2 libyaml = True

  • centos系统

root@centos7 ~]#yum -y install python-pip

[root@centos7 ~]#pip install --upgrade pip

[root@centos7 ~]#pip install ansible --upgrade

[root@centos7 ~]#ansible --version

/usr/lib64/python2.7/site-packages/cryptography/__init__.py:39: 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 a future release.

CryptographyDeprecationWarning,

ansible 2.9.12

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

executable location = /usr/bin/ansible python version = 2.7.5 (default, Apr  2 2020, 13:16:51)[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值