如何在rhel 8/centos 8上安装ansible?

如何在rhel 8/centos 8上安装ansible?,ansible,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

我想在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)
我得到的输出是

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)

EPEL8尚未发布。有一些方案可用,但仍有很多方案正在制定中,回购协议不被视为“普遍可用”

现在,您可以从Python包索引(PyPI)安装Ansible:


如果您使用的是RHEL 8,那么您可以使用subscription manager获取预构建的主机和配置文件的Ansible

此外,您还需要在上创建帐户,然后才能执行此操作:

subscription-manager register --auto-attach

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

yum -y install ansible

ansible --version

ansible 2.8.3配置文件=未配置模块搜索路径=['/home/ec2 user/.ansible/plugins/modules','/usr/share/ansible/plugins/modules']ansible python模块位置=/usr/local/lib/python3.6/site-packages/ansible可执行文件位置=/usr/local/bin/ansible python版本=3.6.8(默认,2019年6月12日,01:12:31)[GCC 8.2.1 20180905(Red Hat 8.2.1-3)]ansible已安装,但现在的问题是我的etc/ansible/中没有配置文件,您可以看到ansible的上述输出——给出的版本表示config file=none提供的全局配置是“细节”之一您可以自己创建它,也可以使用本地ansible.cfg。查看
ansible config dump
中的默认值列表-这将让您开始了解需要在配置中覆盖的内容。