Created
September 5, 2017 15:27
-
-
Save dav1x/7c90f137db4a02f1dd50df351547557e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Retrieve the OpenShift Pool ID | |
command: subscription-manager list --available --matches="{{ rhel_subscription_pool }}" --pool-only | |
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 != '' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment