From 73c59feee9391ce294dcf7de586d64fa13f386f9 Mon Sep 17 00:00:00 2001 From: David Galloway Date: Thu, 8 Apr 2021 14:52:06 -0400 Subject: [PATCH] common: Set releasever on testnodes sooner Signed-off-by: David Galloway --- roles/common/tasks/rhel-entitlements.yml | 10 ++++++++++ roles/testnode/tasks/yum/repos.yml | 7 ------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/roles/common/tasks/rhel-entitlements.yml b/roles/common/tasks/rhel-entitlements.yml index 7b31036a..b1765cfe 100644 --- a/roles/common/tasks/rhel-entitlements.yml +++ b/roles/common/tasks/rhel-entitlements.yml @@ -25,6 +25,16 @@ validate_certs: no when: use_satellite == true +# set the releasever cause without it rhel-7-server-rpms repo fails on rhel7.9 machines +# https://tracker.ceph.com/issues/49771 +# We have to do this here (instead of in testnodes role) because some package transactions fail during the common role. +# However, we do not want to lock the release ver on all our systems; just testnodes. +- name: Set the releasever + copy: + content: "{{ ansible_lsb.release }}" + dest: /etc/yum/vars/releasever + when: inventory_hostname in groups['testnodes'] + - name: Determine if node is registered with subscription-manager. command: subscription-manager identity register: subscription diff --git a/roles/testnode/tasks/yum/repos.yml b/roles/testnode/tasks/yum/repos.yml index f8688599..278d8d7f 100644 --- a/roles/testnode/tasks/yum/repos.yml +++ b/roles/testnode/tasks/yum/repos.yml @@ -48,10 +48,3 @@ when: (repo_file is defined and repo_file is changed) or (gpg_keys is defined and gpg_keys is changed) or (version_repo_file is defined and version_repo_file is changed) - -# set the releasever cause without it rhel-7-server-rpms repo fails on rhel7.9 machines https://tracker.ceph.com/issues/49771 -- name: set the releasevar on rhel - copy: - content: "{{ ansible_lsb.release }}" - dest: /etc/yum/vars/releasever - when: ansible_distribution == "RedHat"