35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
|
---
|
||
|
- name: Check Red Hat distributions
|
||
|
when: ansible_os_family == "RedHat"
|
||
|
block:
|
||
|
- name: Check that this system is in the Red Hat family
|
||
|
ansible.builtin.assert:
|
||
|
that:
|
||
|
- ansible_os_family == "RedHat"
|
||
|
success_msg: "This is a RedHat family system"
|
||
|
fail_msg: "This is NOT a RedHat family system. Goodbye."
|
||
|
|
||
|
- name: Supported distributions only
|
||
|
ansible.builtin.assert:
|
||
|
that:
|
||
|
- (ansible_distribution == "Rocky") or (ansible_distribution == "Fedora")
|
||
|
success_msg: "System is supported"
|
||
|
fail_msg: "System is NOT supported"
|
||
|
|
||
|
- name: EL - Check that major versions are valid
|
||
|
when: ansible_distribution == "Rocky"
|
||
|
ansible.builtin.assert:
|
||
|
that:
|
||
|
- ansible_distribution_major_version|int >= 8
|
||
|
success_msg: "Supported major version of Enterprise Linux"
|
||
|
fail_msg: "This major version is not supported"
|
||
|
|
||
|
- name: Fedora - Check that major versions are valid
|
||
|
when: ansible_distribution == "Fedora"
|
||
|
ansible.builtin.assert:
|
||
|
that:
|
||
|
- ansible_distribution_major_version|int >= 39
|
||
|
success_msg: "Supported major version of Fedora"
|
||
|
fail_msg: "This major version is not supported"
|
||
|
...
|