copr-builders: automatically unsubscribe when subscription fails
Seems the subscription manager Ansible module fails to unregister the machine when the pool attachement fails. This terminates our playbook, and the whole machine - but RHSM keeps tracking the system.
This commit is contained in:
parent
57f259c3e1
commit
f546a6fd96
1 changed files with 10 additions and 0 deletions
|
@ -101,6 +101,16 @@
|
|||
- copr_red_hat_subscription_password is defined
|
||||
tags:
|
||||
- red_hat_subscription
|
||||
ignore_errors: true
|
||||
register: subscription
|
||||
|
||||
- name: Cleanup subscription before failure
|
||||
community.general.redhat_subscription:
|
||||
state: absent
|
||||
when: subscription.failed
|
||||
|
||||
- fail: msg="Could not subscribe"
|
||||
when: subscription.failed
|
||||
|
||||
- name: install copr-builder and other latest packages
|
||||
dnf: state=latest pkg={{ packages }}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue