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