环境准备
# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
# python
Python 3.7.11 (default, Jul 31 2022, 16:12:35)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
# 记得更新 下面2个组件
pip install --upgrade setuptools
python3 -m pip install --upgrade pip
# 安装
pip install ansible
# 查看效果
# ansible --version
[DEPRECATION WARNING]: Ansible will require Python 3.8 or newer on the controller starting with Ansible 2.12. Current version: 3.7.11 (default, Jul 31 2022, 16:12:35) [GCC 4.8.5
20150623 (Red Hat 4.8.5-44)]. This feature will be removed from ansible-core in version 2.12. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.
ansible [core 2.11.12]
config file = None
configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /usr/local/python37/lib/python3.7/site-packages/ansible
ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
executable location = /bin/ansible
python version = 3.7.11 (default, Jul 31 2022, 16:12:35) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
jinja version = 3.1.2
libyaml = True
原创文章,作者:carmelaweatherly,如若转载,请注明出处:https://blog.ytso.com/tech/aiops/278148.html