From: Ken Dreyer Date: Thu, 2 Apr 2015 18:54:00 +0000 (-0600) Subject: enable RHEL repositories from CDN X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ae0ada0bb585633bb0219af814dccfdb2c2d8de3;p=ceph-cm-ansible.git enable RHEL repositories from CDN Note that the testnode role is creating the following .repo files (that point to apt-mirror). With the Red Hat CDN, these are now redundant: - rhel7-extras.repo - rhel7-optional.repo - rhel7.repo These are harmless since they simply contain older versions of packages. Yum will prefer the CDN repositories, since the packages there are newer. Eventually we should figure out a way to remove these, though. --- diff --git a/roles/common/defaults/main.yml b/roles/common/defaults/main.yml new file mode 100644 index 00000000..f83370eb --- /dev/null +++ b/roles/common/defaults/main.yml @@ -0,0 +1,5 @@ +# Repos to enable in Red Hat Subscription Manager +rhsm_repos: + - rhel-7-server-rpms + - rhel-7-server-optional-rpms + - rhel-7-server-extras-rpms diff --git a/roles/common/tasks/rhel-entitlements.yml b/roles/common/tasks/rhel-entitlements.yml index 7a8a756e..b3ee9e2d 100644 --- a/roles/common/tasks/rhel-entitlements.yml +++ b/roles/common/tasks/rhel-entitlements.yml @@ -20,3 +20,19 @@ --org={{ subscription_manager_org }} no_log: true when: subscription.rc != 0 + register: entitled + +- name: disable all rhsm repos + command: subscription-manager repos --disable '*' + when: entitled|changed + +- name: enable necessary rhsm repos + command: subscription-manager repos --enable {{ item }} + with_items: rhsm_repos + when: entitled|changed and rhsm_repos|length > 0 + +- name: Remove old apt-mirror repository definition. + file: + path: /etc/yum.repos.d/cd.repo + state: absent + when: entitled|success