Add compatcheck role
Meant to be used by other roles
This commit is contained in:
15
roles/compatcheck/tasks/main.yaml
Normal file
15
roles/compatcheck/tasks/main.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
---
|
||||
- name: Fail if distribution not supported
|
||||
ansible.builtin.fail:
|
||||
msg: "{{ lookup('ansible.builtin.template', 'distroerror.j2').strip() }}"
|
||||
when: checkfailed
|
||||
loop:
|
||||
- "{{ compatcheck_distro | length == 0 }}"
|
||||
- >
|
||||
{{
|
||||
ansible_distribution_major_version != 'n/a' and
|
||||
compatcheck_distro[0].version_min | default(0) > ansible_distribution_major_version | int
|
||||
}}
|
||||
- "{{ compatcheck_distro[0].version_max is defined and compatcheck_distro[0].version_max < ansible_distribution_major_version | int }}"
|
||||
loop_control:
|
||||
loop_var: checkfailed
|
||||
Reference in New Issue
Block a user