From 7cdc374ced41624c3e1d6f4e7930b31ce4f1be5e Mon Sep 17 00:00:00 2001 From: David Galloway Date: Tue, 28 Apr 2020 16:39:16 -0400 Subject: [PATCH] common: Define release with subscription-manager See comment Signed-off-by: David Galloway --- roles/common/tasks/rhel-entitlements.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/roles/common/tasks/rhel-entitlements.yml b/roles/common/tasks/rhel-entitlements.yml index 0b016ce2..7d00c7e7 100644 --- a/roles/common/tasks/rhel-entitlements.yml +++ b/roles/common/tasks/rhel-entitlements.yml @@ -90,6 +90,13 @@ import_tasks: beta_repos.yml when: ansible_distribution_version not in rhsm_release_list.stdout_lines +# A `dnf group upgrade base` which happens later in the testnodes role will +# update a 8.X system to 8.Y. We don't want that to happen because we +# expect to test on a specific version. This locks a 8.X install to 8.X packages. +- name: Set release number + command: "subscription-manager release --set={{ ansible_distribution_version }}" + when: rhsm_registered == true + - name: Get list of enabled RHSM repos shell: subscription-manager repos --list | grep -B4 'Enabled:.*1' | grep 'Repo ID:' | sed -e 's/Repo ID:\s*\(.*\)/\1/' | sort register: repo_list_cmd -- 2.47.3