2 月 232020
 

查看系统版本和当前默认的Ansible安装版本信息

[root@ip-172-31-40-41 ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 
[root@ip-172-31-40-41 ~]# yum info ansible
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * epel: mirrors.aliyun.com
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
Available Packages
Name        : ansible
Arch        : noarch
Version     : 2.9.3
Release     : 1.el7
Size        : 17 M
Repo        : epel/x86_64
Summary     : SSH-based configuration management, deployment, and task execution system
URL         : http://ansible.com
License     : GPLv3+
Description : Ansible is a radically simple model-driven configuration management,
            : multi-node deployment, and remote task execution system. Ansible works
            : over SSH and does not require any software or daemons to be installed
            : on remote nodes. Extension modules can be written in any language and
            : are transferred to managed machines automatically.

[root@ip-172-31-40-41 ~]#

Redhat Ansible 官方企业级扩展源RMP包

https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/

使用YUM安装当前最新版本2.9.5版本

[root@ip-172-31-40-41 ~]# yum install https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.9.5-1.el7.ans.noarch.rpm
Loaded plugins: fastestmirror
ansible-2.9.5-1.el7.ans.noarch.rpm                                |  17 MB  00:00:03     
Examining /var/tmp/yum-root-6qPFbn/ansible-2.9.5-1.el7.ans.noarch.rpm: ansible-2.9.5-1.el7.ans.noarch
Marking /var/tmp/yum-root-6qPFbn/ansible-2.9.5-1.el7.ans.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package ansible.noarch 0:2.9.5-1.el7.ans will be installed
--> Processing Dependency: python-paramiko for package: ansible-2.9.5-1.el7.ans.noarch
Loading mirror speeds from cached hostfile
 * base: d36uatko69830t.cloudfront.net
 * epel: fedora.cs.nctu.edu.tw
 * extras: d36uatko69830t.cloudfront.net
 * updates: d36uatko69830t.cloudfront.net
--> Processing Dependency: sshpass for package: ansible-2.9.5-1.el7.ans.noarch
--> Running transaction check
---> Package python-paramiko.noarch 0:2.1.1-9.el7 will be installed
---> Package sshpass.x86_64 0:1.06-2.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================
 Package           Arch     Version              Repository                         Size
=========================================================================================
Installing:
 ansible           noarch   2.9.5-1.el7.ans      /ansible-2.9.5-1.el7.ans.noarch   103 M
Installing for dependencies:
 python-paramiko   noarch   2.1.1-9.el7          base                              269 k
 sshpass           x86_64   1.06-2.el7           extras                             21 k

Transaction Summary
=========================================================================================
Install  1 Package (+2 Dependent packages)

Total size: 103 M
Total download size: 290 k
Installed size: 104 M
Is this ok [y/d/N]:

查看已安装的Ansible版本信息

[root@ip-172-31-40-41 ~]# ansible --version
ansible 2.9.5
  config file = /etc/ansible/ansible.cfg
  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 = /bin/ansible
  python version = 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)]
[root@ip-172-31-40-41 ~]#