ansible在centos7和centos8下的安装

ansible在centos7和centos8下的安装

centos7下

# 写入ansible的yum源
[root@centos7_server yum.repos.d]# vim rocky.repo 
[appstream]
name=appstream
baseurl=https://mirrors.aliyun.com/epel/7/x86_64/
gpgcheck=0
# 下载ansible
[root@centos7_server ~]# yum install ansible -y
# 检查ansible版本
[root@centos7_server yum.repos.d]# ansible --version
ansible 2.9.27
  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 = /usr/bin/ansible
  python version = 2.7.5 (default, Oct 14 2020, 14:45:30) [GCC 4.8.5 20150623 (Red Hat 4.8.5-44)]
[root@centos7_server yum.repos.d]# ansible localhost -m ping
localhost | SUCCESS => {
    "changed": false, 
    "ping": "pong"
}

centos8下

# 编写centos8下的yum源
[root@centos8_server ~]# vim /etc/yum.repos.d/equl.repo 
[equl]
name = equl
baseurl = https://mirrors.aliyun.com/epel-archive/8.2.2020-11-04/Everything/x86_64/
gpgcheck = 0
# 下载ansible
[root@centos7_server ~]# yum install ansible -y
# 查看ansible版本
[root@centos8_server ~]# ansible --version
ansible 2.9.14
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.6/site-packages/ansible
  executable location = /usr/bin/ansible
  python version = 3.6.8 (default, Sep 10 2021, 09:13:53) [GCC 8.5.0 20210514 (Red Hat 8.5.0-3)]
[root@centos8_server ~]# ansible localhost -m ping
localhost | SUCCESS => {
    "changed": false,
    "ping": "pong"
}

猜你喜欢

转载自blog.csdn.net/bo1029/article/details/127967871