2020-12-21 20:14:52 +01:00
|
|
|
---
|
|
|
|
|
|
|
|
- name: Check that {{ package.name }} is installed
|
2021-04-10 13:15:51 +02:00
|
|
|
ansible.builtin.command:
|
|
|
|
cmd: "which {{ package.name }}"
|
2020-12-21 20:14:52 +01:00
|
|
|
changed_when: false
|
|
|
|
failed_when: false
|
|
|
|
register: check_k3s_required_package
|
|
|
|
|
|
|
|
- name: Test that checks for {{ package.name }} passed
|
|
|
|
ansible.builtin.assert:
|
|
|
|
that:
|
|
|
|
- check_k3s_required_package.rc == 0
|
|
|
|
success_msg: "Found required package: {{ package.name }}."
|
|
|
|
fail_msg: >-
|
|
|
|
Could not find package: {{ package.name }}.
|
|
|
|
{% if package.documentation is defined %}
|
|
|
|
Documentation: {{ package.documentation }}
|
|
|
|
{% endif %}
|
2021-02-16 16:46:01 +01:00
|
|
|
when:
|
2021-12-19 22:41:59 +01:00
|
|
|
- check_k3s_required_package.rc is defined
|
2021-02-16 16:46:01 +01:00
|
|
|
- (package.until is not defined
|
2021-12-19 22:41:59 +01:00
|
|
|
or (k3s_release_version | replace('v', '')) is version_compare(package.until, '>='))
|
2021-02-16 16:46:01 +01:00
|
|
|
- (package.from is not defined
|
2021-12-19 22:41:59 +01:00
|
|
|
or (k3s_release_version | replace('v', '')) is version_compare(package.from, '>='))
|