Redhat RHE9 ansible 在系统上列出存储库时引发无效的存储库 ID

问题描述 投票:0回答:1

我正在我的一台 AWS EC2 上运行 Linux Redhat 9,并且我正在尝试安装 OpenVPN 服务器。

为此,我想启用

codeready-builder
存储库。

这是启用存储库的 ansible 任务:

15 - name: Enable extra repos for RHEL 9
16   rhsm_repository:
17     name: "codeready-builder-for-rhel-9-{{ ansible_architecture }}-rpms"
18     state: enabled
19   when: ansible_distribution=="RedHat" and ansible_distribution_major_version == "9"

它会抛出以下错误:

我连接到目标系统并运行

dnf repolist --all
,我得到了这个

所以我认为问题确实出在 repo id 上,所以我修改了任务并将

codeready-builder-for-rhel-9-{{ ansible_architecture }}-rpms
更改为
codeready-builder-for-rhel-9-rhui-rpms
这个 :

15 - name: Enable extra repos for RHEL 9
16   rhsm_repository:
17     name: "codeready-builder-for-rhel-9-rhui-rpms"
18     state: enabled
19   when: ansible_distribution=="RedHat" and ansible_distribution_major_version == "9"

但我仍然收到错误:

所以我真的不明白问题出在哪里。我是否错过了任何有用的步骤?

linux amazon-ec2 ansible redhat openvpn
1个回答
0
投票

尝试使用通配符启用:

- name: enable repos
  rhsm_repository:
    name: "codeready*rhui-rpms"
    state: enabled

检查是否有效。

© www.soinside.com 2019 - 2024. All rights reserved.