diff options
author | Tlacenka <tlacencin@gmail.com> | 2017-07-17 12:47:03 +0200 |
---|---|---|
committer | Tomas Sedovic <tomas@sedovic.cz> | 2017-07-17 12:47:03 +0200 |
commit | bef7807177915fe4861fcef5c4a78884f49b3b0e (patch) | |
tree | 86ee883b756909f567204cbe23b8706d7e24a9e0 | |
parent | 0fca1b86f15ed373d419574cb62fbd15ba841af7 (diff) | |
download | openshift-bef7807177915fe4861fcef5c4a78884f49b3b0e.tar.gz openshift-bef7807177915fe4861fcef5c4a78884f49b3b0e.tar.bz2 openshift-bef7807177915fe4861fcef5c4a78884f49b3b0e.tar.xz openshift-bef7807177915fe4861fcef5c4a78884f49b3b0e.zip |
Retry tasks in the subscription manager role (#552)
* subscription manager: added 10 retries after 1 second delay
* subscription manager: added untils
* sub manager: typo
-rw-r--r-- | roles/subscription-manager/tasks/main.yml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/subscription-manager/tasks/main.yml b/roles/subscription-manager/tasks/main.yml index 8c1ae697a..e4c9fdffb 100644 --- a/roles/subscription-manager/tasks/main.yml +++ b/roles/subscription-manager/tasks/main.yml @@ -52,6 +52,10 @@ when: - not registered - rhsm_authentication is defined + register: cleaningsubs_result + until: cleaningsubs_result.rc == 0 + retries: 10 + delay: 1 - name: "Install Satellite certificate" command: "rpm -Uvh --force http://{{ rhsm_satellite }}/pub/katello-ca-consumer-latest.noarch.rpm" @@ -69,6 +73,10 @@ - rhsm_satellite is defined - rhsm_satellite is not none - rhsm_satellite|trim != '' + register: register_key_result + until: register_key_result.rc == 0 + retries: 10 + delay: 1 # This can apply to either Hosted or Satellite - name: "Register using username and password" @@ -78,6 +86,10 @@ - not registered - rhsm_authentication == "password" - rhsm_org is not defined or rhsm_org is none or rhsm_org|trim == '' + register: register_userpw_result + until: register_userpw_result.rc == 0 + retries: 10 + delay: 1 # This can apply to either Hosted or Satellite - name: "Register using username, password and organization" @@ -89,12 +101,20 @@ - rhsm_org is defined - rhsm_org is not none - rhsm_org|trim != '' + register: register_userpworg_result + until: register_userpworg_result.rc == 0 + retries: 10 + delay: 1 - name: "Auto-attach to Subscription Manager Pool" command: "/usr/bin/subscription-manager attach --auto" when: - not registered - rhsm_pool is undefined or rhsm_pool is none or rhsm_pool|trim == '' + register: autoattach_result + until: autoattach_result.rc == 0 + retries: 10 + delay: 1 - name: "Attach to a specific pool" command: "/usr/bin/subscription-manager attach --pool={{ rhsm_pool }}" @@ -103,6 +123,10 @@ - rhsm_pool is not none - rhsm_pool|trim != '' - not registered + register: attachpool_result + until: attachpool_result.rc == 0 + retries: 10 + delay: 1 - name: "Disable all repositories" command: "/usr/bin/subscription-manager repos --disable=*" @@ -120,3 +144,7 @@ - rhsm_repos is defined - rhsm_repos is not none - rhsm_repos|trim != '' + register: enablerepos_result + until: enablerepos_result.rc == 0 + retries: 10 + delay: 1 |