首页 > 解决方案 > 如何在 rhel 8 /centos 8 上安装 ansible?

问题描述

我想在 RHEL 8 Centos 中安装 ansible。要使用 yum install ansible 我必须启用 epel 发布,但我找不到 Rhel 8 的最佳 epel 发布来源。

我试过这个

sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

sudo yum install ansible

我得到的输出是

Last metadata expiration check: 0:01:26 ago on Sun 11 Aug 2019 12:21:55 PM UTC.
Error:
 Problem: conflicting requests
  - nothing provides python-setuptools needed by ansible-2.8.2-1.el7.noarch
  - nothing provides python-jinja2 needed by ansible-2.8.2-1.el7.noarch
  - nothing provides python-six needed by ansible-2.8.2-1.el7.noarch
  - nothing provides PyYAML needed by ansible-2.8.2-1.el7.noarch
  - nothing provides python2-cryptography needed by ansible-2.8.2-1.el7.noarch
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

标签: ansible

解决方案


如果您使用的是 RHEL 8,那么您可以使用订阅管理器来获取预先构建的主机和配置文件的 Ansible。

此外,您需要先在https://developers.redhat.com上创建一个帐户,然后才能执行此操作:

subscription-manager register --auto-attach

subscription-manager repos --enable ansible-2.8-for-rhel-8-x86_64-rpms

yum -y install ansible

ansible --version

推荐阅读