debian-forge-composer/templates/packer/ansible/roles/common/tasks/subscribe.yml
Sanne Raymaekers 13aae7d532 templates/packer: invert tag logic
With the rpmcopy or rpmrepo_osbuild tags, the `Install worker rpm` stage
got skipped on RHEL and CI. Invert the tag logic and use `--tags`
instead of `--skip-tags`.
2024-05-21 09:40:11 +02:00

29 lines
827 B
YAML

---
# Subscribe the machine to avoid a mismatch between the RPMs (which are build using CDN content) and
# the packer instances (RHUI, which might be older).
- name: Subscribe
tags:
- rhel
community.general.redhat_subscription:
activationkey: "{{ RH_ACTIVATION_KEY }}"
org_id: "{{ RH_ORG_ID }}"
register: result
retries: 5
until: result is success
- name: Enable repo mgmt through subman
become: yes
tags:
- rhel
shell: >-
subscription-manager config --rhsm.manage_repos 1
- name: Enable cdn repos
become: yes
tags:
- rhel
shell: >-
subscription-manager repos \
--enable rhel-9-for-{{ ansible_architecture }}-appstream-rpms \
--enable rhel-9-for-{{ ansible_architecture }}-baseos-rpms \
--enable codeready-builder-for-rhel-9-{{ ansible_architecture }}-rpms