Skip to content

Commit 25d560f

Browse files
mnasiadkayoctozepto
authored andcommitted
Validate if running CentOS OS is CentOS Stream
Change-Id: I2fe738249018e25e79fd726bc931be6b7bd91934 (cherry picked from commit d56dc34)
1 parent af7a9f7 commit 25d560f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ansible/roles/prechecks/tasks/host_os_checks.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,18 @@
1717
- ansible_facts.distribution_release not in host_os_distributions[ansible_facts.distribution]
1818
- ansible_facts.distribution_version not in host_os_distributions[ansible_facts.distribution]
1919
- ansible_facts.distribution_major_version not in host_os_distributions[ansible_facts.distribution]
20+
21+
- name: Checking if CentOS is Stream
22+
become: true
23+
command: grep -q Stream /etc/os-release
24+
register: stream_status
25+
changed_when: false
26+
when:
27+
- ansible_facts.distribution == 'CentOS'
28+
29+
- name: Fail if not running on CentOS Stream
30+
fail:
31+
msg: CentOS Linux is not supported, you need to run CentOS Stream.
32+
when:
33+
- ansible_facts.distribution == 'CentOS'
34+
- stream_status.rc != 0

0 commit comments

Comments
 (0)