debian-forge-composer/templates/packer/ansible/roles/common/tasks/subscribe.yml
2023-09-25 11:56:42 +02:00

29 lines
842 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:
- subscribe
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:
- subscribe
shell: >-
subscription-manager config --rhsm.manage_repos 1
- name: Enable cdn repos
become: yes
tags:
- subscribe
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