summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason DeTiberus <detiber@gmail.com>2016-05-17 13:19:23 -0400
committerJason DeTiberus <detiber@gmail.com>2016-05-17 13:19:23 -0400
commitc86bdc4774db99ca0dba797edf0c6d6a2ea4cd24 (patch)
tree3da9fe465a0bd4fffc4dd496b48ce9bab6998c7f
parent52fb67051ea66b6da0c82ddeefbd0bf1567ed207 (diff)
parent924f8c2b8fac6faefbd93bf37d219adc2f1ac656 (diff)
downloadopenshift-c86bdc4774db99ca0dba797edf0c6d6a2ea4cd24.tar.gz
openshift-c86bdc4774db99ca0dba797edf0c6d6a2ea4cd24.tar.bz2
openshift-c86bdc4774db99ca0dba797edf0c6d6a2ea4cd24.tar.xz
openshift-c86bdc4774db99ca0dba797edf0c6d6a2ea4cd24.zip
Merge pull request #1691 from abutcher/rhel-subscribe
Check consumed pools prior to attaching.
-rw-r--r--roles/rhel_subscribe/tasks/main.yml11
1 files changed, 11 insertions, 0 deletions
diff --git a/roles/rhel_subscribe/tasks/main.yml b/roles/rhel_subscribe/tasks/main.yml
index 85e17ff9d..343020dce 100644
--- a/roles/rhel_subscribe/tasks/main.yml
+++ b/roles/rhel_subscribe/tasks/main.yml
@@ -37,8 +37,19 @@
register: openshift_pool_id
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
+ changed_when: False
+ when: openshift_pool_id.stdout == ''
+
+- fail:
+ msg: "Unable to find pool matching {{ rhel_subscription_pool }} in available or consumed pools"
+ when: openshift_pool_id.stdout == '' and openshift_pool_attached is defined and openshift_pool_attached.stdout == ''
+
- name: Attach to OpenShift Pool
command: subscription-manager subscribe --pool {{ openshift_pool_id.stdout_lines[0] }}
+ when: openshift_pool_id.stdout != ''
- include: enterprise.yml
when: deployment_type in [ 'enterprise', 'atomic-enterprise', 'openshift-enterprise' ] and