diff options
author | Thomas Wiest <twiest@users.noreply.github.com> | 2015-07-17 16:22:09 -0400 |
---|---|---|
committer | Thomas Wiest <twiest@users.noreply.github.com> | 2015-07-17 16:22:09 -0400 |
commit | 27c0895327dc5d1153aae6c63e7a70f13eb1f0d4 (patch) | |
tree | a7a850a3f490e89fbc4956013a3e95bde08552eb /roles | |
parent | b37fcf39edf13c90e7df33b41b4ca8de0aca0838 (diff) | |
parent | fb4083bb920d193c2f292b49f370667029c317ba (diff) | |
download | openshift-27c0895327dc5d1153aae6c63e7a70f13eb1f0d4.tar.gz openshift-27c0895327dc5d1153aae6c63e7a70f13eb1f0d4.tar.bz2 openshift-27c0895327dc5d1153aae6c63e7a70f13eb1f0d4.tar.xz openshift-27c0895327dc5d1153aae6c63e7a70f13eb1f0d4.zip |
Merge pull request #264 from lhuard1A/rhel_subscription
Implement RHEL subscription for enterprise deployment type
Diffstat (limited to 'roles')
-rw-r--r-- | roles/rhel_subscribe/tasks/enterprise.yml | 5 | ||||
-rw-r--r-- | roles/rhel_subscribe/tasks/main.yml | 29 | ||||
-rw-r--r-- | roles/rhel_unsubscribe/tasks/main.yml | 5 |
3 files changed, 39 insertions, 0 deletions
diff --git a/roles/rhel_subscribe/tasks/enterprise.yml b/roles/rhel_subscribe/tasks/enterprise.yml new file mode 100644 index 000000000..fc4d44745 --- /dev/null +++ b/roles/rhel_subscribe/tasks/enterprise.yml @@ -0,0 +1,5 @@ +--- +- name: Enable RHEL repositories + command: subscription-manager repos \ + --enable="rhel-7-server-rpms" \ + --enable="rhel-7-server-ose-3.0-rpms" diff --git a/roles/rhel_subscribe/tasks/main.yml b/roles/rhel_subscribe/tasks/main.yml new file mode 100644 index 000000000..8fb2fc042 --- /dev/null +++ b/roles/rhel_subscribe/tasks/main.yml @@ -0,0 +1,29 @@ +--- +# TODO: Enhance redhat_subscription module +# to make it able to attach to a pool +# to make it able to enable repositories + +- set_fact: + rhel_subscription_user: "{{ lookup('oo_option', 'rhel_subscription_user') | default(rhsub_user, True) | default(omit, True) }}" + rhel_subscription_pass: "{{ lookup('oo_option', 'rhel_subscription_pass') | default(rhsub_pass, True) | default(omit, True) }}" + +- fail: + msg: "This role is only supported for Red Hat hosts" + when: ansible_distribution != 'RedHat' + +- fail: + msg: Either rsub_user or the rhel_subscription_user env variable are required for this role. + when: rhel_subscription_user is not defined + +- fail: + msg: Either rsub_pass or the rhel_subscription_pass env variable are required for this role. + when: rhel_subscription_pass is not defined + +- name: RedHat subscriptions + redhat_subscription: + username: "{{ rhel_subscription_user }}" + password: "{{ rhel_subscription_pass }}" + autosubscribe: yes + +- include: enterprise.yml + when: deployment_type == 'enterprise' diff --git a/roles/rhel_unsubscribe/tasks/main.yml b/roles/rhel_unsubscribe/tasks/main.yml new file mode 100644 index 000000000..2aeb09d83 --- /dev/null +++ b/roles/rhel_unsubscribe/tasks/main.yml @@ -0,0 +1,5 @@ +--- +- name: Remove RedHat subscriptions + redhat_subscription: + state: absent + when: ansible_distribution == "RedHat" |