Merge "Validate if running CentOS OS is CentOS Stream"

This commit is contained in:
Zuul 2021-08-16 10:25:16 +00:00 committed by Gerrit Code Review
commit ea008fd7fe

View File

@ -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