]> git.apps.os.sepia.ceph.com Git - ceph-cm-ansible.git/commitdiff
testnode: Alternate method of detecting Stream
authorDavid Galloway <dgallowa@redhat.com>
Thu, 10 Feb 2022 18:39:59 +0000 (13:39 -0500)
committerDavid Galloway <dgallowa@redhat.com>
Thu, 10 Feb 2022 18:39:59 +0000 (13:39 -0500)
Signed-off-by: David Galloway <dgallowa@redhat.com>
roles/testnode/tasks/yum/stream.yml
roles/testnode/tasks/yum_systems.yml
roles/testnode/vars/yum_systems.yml

index 19eabcfc57fda004f43002b0e099f4519371fe07..c216c9ea7348bc1b4611dd6bb1766fec6dea974f 100644 (file)
@@ -4,16 +4,6 @@
 # We just don't want to rely on CentOS' infra to provide our mirror lists.  It has bitten us in the past.
 - name: Clean up Stream distro-provided repos
   shell: "rm -rvf /etc/yum.repos.d/*-Stream-*"
-  when:
-    - ansible_lsb.description is defined
-    - '"Stream" in ansible_lsb.description'
-
-# Setting this var will add "-stream" to the mirrorlist/baseurl URLs in .repo files
-- set_fact:
-    dash_stream: "-stream"
-  when:
-    - ansible_lsb.description is defined
-    - '"Stream" in ansible_lsb.description'
 
 - name: Include CentOS Stream specific variables
   include_vars: "{{ item }}"
index 674a453d69cdf7edfcc6044adffe284ba7005603..44f36f32fad73c1ded9eaa405a76dd7e1cb42f59 100644 (file)
   command:
     rpm --rebuilddb
 
+- name: Check /etc/os-release to see if this is CentOS Stream
+  shell: "grep 'CentOS Stream' /etc/os-release || true"
+  register: stream_in_osrelease
+  tags:
+    - repos
+
+# Setting this var will add "-stream" to the mirrorlist/baseurl URLs in .repo files
+- set_fact:
+    dash_stream: "-stream"
+    is_stream: true
+  when: (ansible_lsb.description is defined and "Stream" in ansible_lsb.description) or
+        stream_in_osrelease.stdout is search("CentOS Stream")
+  tags:
+    - repos
+
 - name: Perform CentOS Stream related tasks
   import_tasks: yum/stream.yml
-  when:
-    - ansible_lsb.description is defined
-    - '"Stream" in ansible_lsb.description'
+  when: is_stream|default('false')|bool
   tags:
     - repos
 
index 4eee5f094ff797cf00913a810115ffb295cb3fcb..acfdf123efe963ab843a1a52f895857cf0ea71b0 100644 (file)
@@ -44,6 +44,6 @@ ceph_dependency_packages_to_remove:
 pip_packages_to_install:
   - remoto>=0.0.35
 
-# This gets defined to "-stream" in roles/testnode/tasks/yum/repos.yml when CentOS Stream is the OS.
+# This gets defined to "-stream" in roles/testnode/tasks/yum_systems.yml when CentOS Stream is the OS.
 # It adds "-stream" to yum repo mirrorlist URLs.
 dash_stream: ""