compatcheck: Support checking for package manager
Some distros (fedora) have dnf by default but may be atomic also
This commit is contained in:
@@ -2,14 +2,12 @@
|
||||
- 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 }}"
|
||||
when: >
|
||||
_compatcheck_distro | length != 1 or (
|
||||
ansible_distribution_major_version != 'n/a' and
|
||||
_compatcheck_distro[0].version_min | default(0) > ansible_distribution_major_version | int
|
||||
) or
|
||||
_compatcheck_distro[0].version_max is defined and _compatcheck_distro[0].version_max < ansible_distribution_major_version | int or
|
||||
ansible_pkg_mgr not in _compatcheck_distro[0].package_managers | default([_compatcheck_default_package_manager])
|
||||
loop_control:
|
||||
loop_var: checkfailed
|
||||
|
||||
Reference in New Issue
Block a user