# 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 }}"
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
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: ""