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.
--- /dev/null
+# Repos to enable in Red Hat Subscription Manager
+rhsm_repos:
+ - rhel-7-server-rpms
+ - rhel-7-server-optional-rpms
+ - rhel-7-server-extras-rpms
--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