我的 ansible 角色之一调用 rhsm_repository 模块:
- name: Enable Red Hat Software Collections repo
rhsm_repository:
name: rhel-server-rhscl-7-rpms
when: ( ansible_os_family == "RedHat" and ansible_facts['distribution_major_version'] == "7")
我正在向角色添加分子测试,但收敛步骤无法启用存储库:
TASK [mariadb : Enable Red Hat Software Collections repo]
*********************************************************
fatal: [rhel7]: FAILED! => {"changed": false, "msg": "rhel-server-rhscl-7-rpms is not a valid repository ID", "results": ["rhel-server-rhscl-7-rpms is not a valid repository ID"]}
在容器中运行subscription-manager
命令也会失败。
subscription-manager
是此模块 AFAICT 使用的命令。
[root@rhel7 /]# subscription-manager status
subscription-manager is disabled when running inside a container. Please refer to your host system for subscription management.
我的主机是 RHEL8,所以即使我愿意,我也无法启用 repo。但是使用分子的想法是允许测试各种发行版,因此无论如何这似乎都是错误的方法。
如何在容器中rhsm_repository
使用分子测试模块?podman
我的分子的platform
定义是:
- name: rhel7
image: registry.access.redhat.com/ubi7/ubi-init
command: "/usr/sbin/init"
tmpfs:
- /run
- /tmp
pre_build_image: true