1、使用yum包管理器安装
#创建安装包下载目录
mkdir -p /data/soft/ansible
#下载ansible及其所有依赖
yum -y install epel-release #CentOS系统需要安装第三方yum源
yum install -y ansible --downloadonly --downloaddir=/data/soft/ansible
#离线安装
cd /data/soft/ansible
yum localinstall *.rpm -y
#查看版本
ansible --version
2、使用pip安装
cd /data/soft/ansible
pip3 download --index-url https://mirrors.aliyun.com/pypi/simple/ ansible==2.9.27
#离线安装
pip3 install ansible==2.9.27 --no-index --find-links=file:///data/soft/ansible
#查看版本
ansible --version
# 下载ansible的RPM包,也可以直接使用rpm包进行安装
https://releases.ansible.com/ansible/rpm/release/ansible-2.9.10-1.el7.ans.noarch.rpm
https://pkgs.org/search/?q=ansible
https://rpmfind.net/linux/rpm2html/search.php?query=ansible&submit=Search+...
sudo rpm -ivh ansible-2.9.10-1.el7.ans.noarch.rpm #安装



