From d56dc34034384e5543698e980b71d911729770df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Nasiadka?= Date: Tue, 10 Aug 2021 14:09:27 +0200 Subject: [PATCH] Validate if running CentOS OS is CentOS Stream Change-Id: I2fe738249018e25e79fd726bc931be6b7bd91934 --- ansible/roles/prechecks/tasks/host_os_checks.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ansible/roles/prechecks/tasks/host_os_checks.yml b/ansible/roles/prechecks/tasks/host_os_checks.yml index 85f59d130e..12dc80e5dc 100644 --- a/ansible/roles/prechecks/tasks/host_os_checks.yml +++ b/ansible/roles/prechecks/tasks/host_os_checks.yml @@ -17,3 +17,18 @@ - ansible_facts.distribution_release not in host_os_distributions[ansible_facts.distribution] - ansible_facts.distribution_version not in host_os_distributions[ansible_facts.distribution] - ansible_facts.distribution_major_version not in host_os_distributions[ansible_facts.distribution] + +- name: Checking if CentOS is Stream + become: true + command: grep -q Stream /etc/os-release + register: stream_status + changed_when: false + when: + - ansible_facts.distribution == 'CentOS' + +- name: Fail if not running on CentOS Stream + fail: + msg: CentOS Linux is not supported, you need to run CentOS Stream. + when: + - ansible_facts.distribution == 'CentOS' + - stream_status.rc != 0