summaryrefslogtreecommitdiffstats
path: root/roles/rhel_subscribe
diff options
context:
space:
mode:
authorLénaïc Huard <lhuard@amadeus.com>2017-03-28 12:20:45 +0200
committerLénaïc Huard <lhuard@amadeus.com>2017-05-02 10:12:39 +0200
commit91a6e0a86a783ce25c090a4946a6ada20363ba6c (patch)
tree9608775c618a0d8faabbe2d96543725649a60ec1 /roles/rhel_subscribe
parent81cf5123366814d098b7ca169a6e4deb2759507d (diff)
downloadopenshift-91a6e0a86a783ce25c090a4946a6ada20363ba6c.tar.gz
openshift-91a6e0a86a783ce25c090a4946a6ada20363ba6c.tar.bz2
openshift-91a6e0a86a783ce25c090a4946a6ada20363ba6c.tar.xz
openshift-91a6e0a86a783ce25c090a4946a6ada20363ba6c.zip
Make RH subscription more resilient to temporary failures
subscription-manager can sometimes fail because of server side errors. Manually replaying the command usually works. So, let’s make openshift-ansible more resilient to temporary failures of subscription-manager by retrying the failed commands with a maximum of 3 retries.
Diffstat (limited to 'roles/rhel_subscribe')
-rw-r--r--roles/rhel_subscribe/tasks/main.yml6
1 files changed, 6 insertions, 0 deletions
diff --git a/roles/rhel_subscribe/tasks/main.yml b/roles/rhel_subscribe/tasks/main.yml
index 28c3c7080..d9959be3c 100644
--- a/roles/rhel_subscribe/tasks/main.yml
+++ b/roles/rhel_subscribe/tasks/main.yml
@@ -36,15 +36,19 @@
redhat_subscription:
username: "{{ rhel_subscription_user }}"
password: "{{ rhel_subscription_pass }}"
+ register: rh_subscription
+ until: rh_subscription | succeeded
- name: Retrieve the OpenShift Pool ID
command: subscription-manager list --available --matches="{{ rhel_subscription_pool }}" --pool-only
register: openshift_pool_id
+ until: openshift_pool_id | succeeded
changed_when: False
- name: Determine if OpenShift Pool Already Attached
command: subscription-manager list --consumed --matches="{{ rhel_subscription_pool }}" --pool-only
register: openshift_pool_attached
+ until: openshift_pool_attached | succeeded
changed_when: False
when: openshift_pool_id.stdout == ''
@@ -54,6 +58,8 @@
- name: Attach to OpenShift Pool
command: subscription-manager subscribe --pool {{ openshift_pool_id.stdout_lines[0] }}
+ register: subscribe_pool
+ until: subscribe_pool | succeeded
when: openshift_pool_id.stdout != ''
- include: enterprise.yml