2019-12-21 18:11:30 +01:00
|
|
|
---
|
|
|
|
|
2020-11-29 21:10:42 +01:00
|
|
|
- name: "Check that k3s_release_version >= {{ k3s_min_version }}"
|
2020-12-12 15:27:59 +01:00
|
|
|
ansible.builtin.assert:
|
2019-12-21 18:11:30 +01:00
|
|
|
that:
|
2020-11-29 21:10:42 +01:00
|
|
|
- (k3s_release_version | replace('v', '')) is version_compare(k3s_min_version, '>=')
|
2020-10-22 20:26:15 +02:00
|
|
|
success_msg: "{{ k3s_release_version }} is supported by this role."
|
|
|
|
fail_msg: "{{ k3s_release_version }} is not supported by this role, please use xanmanning.k3s v1.x."
|
2019-12-21 18:11:30 +01:00
|
|
|
|
2020-12-05 22:56:28 +01:00
|
|
|
- name: Check configuration in k3s_server and k3s_agent that needs special configuration
|
2020-12-12 15:27:59 +01:00
|
|
|
ansible.builtin.assert:
|
2020-10-23 17:31:21 +02:00
|
|
|
that:
|
|
|
|
- (item.setting not in k3s_runtime_config)
|
|
|
|
success_msg: "{{ item.setting }} not found in server/agent config"
|
2020-12-21 20:14:52 +01:00
|
|
|
fail_msg: >-
|
|
|
|
{{ item.setting }} found in server/agent config.
|
|
|
|
Please set {{ item.correction }} to use this option.
|
|
|
|
{% if item.document is defined %}
|
|
|
|
Documentation: {{ item.documentation }}
|
|
|
|
{% endif %}
|
2020-10-23 17:31:21 +02:00
|
|
|
loop: "{{ k3s_config_exclude }}"
|
|
|
|
|
2020-12-05 22:56:28 +01:00
|
|
|
- name: Check configuration in k3s_server and k3s_agent for deprecated configuration
|
2020-12-12 15:27:59 +01:00
|
|
|
ansible.builtin.assert:
|
2020-12-05 22:56:28 +01:00
|
|
|
that:
|
|
|
|
- (item.setting not in k3s_runtime_config)
|
2021-01-10 17:18:18 +01:00
|
|
|
or (not k3s_runtime_config[item.setting])
|
2020-12-05 22:56:28 +01:00
|
|
|
success_msg: "{{ item.setting }} not found in server/agent config"
|
2020-12-21 20:14:52 +01:00
|
|
|
fail_msg: >-
|
|
|
|
{{ item.setting }} found in server/agent config.
|
|
|
|
Please set {{ item.correction }} to use this option.
|
|
|
|
{% if item.document is defined %}
|
|
|
|
Documentation: {{ item.documentation }}
|
|
|
|
{% endif %}
|
2020-12-05 22:56:28 +01:00
|
|
|
loop: "{{ k3s_deprecated_config }}"
|
2021-02-16 16:46:01 +01:00
|
|
|
when:
|
|
|
|
- (item.when is not defined
|
|
|
|
or (item.when is defined and (k3s_release_version | replace('v', '')) is version_compare(item.when, '>=')))
|
|
|
|
- not k3s_use_unsupported_config
|
2020-12-05 22:56:28 +01:00
|
|
|
|
2020-11-29 21:10:42 +01:00
|
|
|
- name: Check configuration in k3s_server and k3s_agent against release version
|
2020-12-12 15:27:59 +01:00
|
|
|
ansible.builtin.assert:
|
2020-11-29 21:10:42 +01:00
|
|
|
that:
|
|
|
|
- (k3s_release_version | replace('v', '')) is version_compare(item.version, '>=')
|
|
|
|
success_msg: "{{ item.setting }} is supported by {{ k3s_release_version }}"
|
2020-12-21 20:14:52 +01:00
|
|
|
fail_msg: >-
|
|
|
|
{{ item.setting }} is not supported in {{ k3s_release_version }}.
|
|
|
|
Please update to v{{ item.version }} to use this option.
|
|
|
|
{% if item.document is defined %}
|
|
|
|
Documentation: {{ item.documentation }}
|
|
|
|
{% endif %}
|
2020-11-29 21:10:42 +01:00
|
|
|
loop: "{{ k3s_config_version_check }}"
|
2021-02-16 16:46:01 +01:00
|
|
|
when:
|
|
|
|
- k3s_config_version_check is defined
|
|
|
|
- item.setting in k3s_runtime_config
|