ansible-role-k3s/tasks/validate/configuration/variables.yml
Xan Manning e7c714424c
Tiidy up and refactoring of tasks (#80)
* Tidy up and refactoring of tasks

  - `k3s_config_dir` derived from `k3s_config_file`, reused throughout the role
    to allow for easy removal of "Rancher" references #73.
  - `k3s_token_location` has moved to be in `k3s_config_dir`.
  - Tasks for creating directories now looped to caputure configuration from
    `k3s_server` and `k3s_agent` and ensure directories exist before k3s
    starts, see #75.
  - Server token collected directly from token file, not symlinked file
    (node-token).
  - `k3s_runtime_config` defined in `vars/` for validation and overwritten in
    tasks for control plane and workers.
  - Removed unused references to GitHub API.

* set_fact now uses FQCN

* re-pin molecule<3.2

* Command module now uses FQCN

* Added package checks for #72

* Reorder task files

  - Docker tasks moved into a separate directory for ease of removal #67
  - Bugfix: Control plane on alternate port didn't work.
  - Validation tasks grouped

* Fix Fedora tests

* Add optional documentation links to validations steps #76

* Removed jmespath requirement

* Fix issue with data collection

* Release candidate
2020-12-21 19:14:52 +00:00

52 lines
2.2 KiB
YAML

---
- name: "Check that k3s_release_version >= {{ k3s_min_version }}"
ansible.builtin.assert:
that:
- (k3s_release_version | replace('v', '')) is version_compare(k3s_min_version, '>=')
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."
- name: Check configuration in k3s_server and k3s_agent that needs special configuration
ansible.builtin.assert:
that:
- (item.setting not in k3s_runtime_config)
success_msg: "{{ item.setting }} not found in server/agent config"
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 %}
loop: "{{ k3s_config_exclude }}"
- name: Check configuration in k3s_server and k3s_agent for deprecated configuration
ansible.builtin.assert:
that:
- (item.setting not in k3s_runtime_config)
success_msg: "{{ item.setting }} not found in server/agent config"
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 %}
loop: "{{ k3s_deprecated_config }}"
when: (item.when is not defined
or (item.when is defined and (k3s_release_version | replace('v', '')) is version_compare(item.when, '>=')))
and not k3s_use_unsupported_config
- name: Check configuration in k3s_server and k3s_agent against release version
ansible.builtin.assert:
that:
- (k3s_release_version | replace('v', '')) is version_compare(item.version, '>=')
success_msg: "{{ item.setting }} is supported by {{ k3s_release_version }}"
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 %}
loop: "{{ k3s_config_version_check }}"
when: k3s_config_version_check is defined
and item.setting in k3s_runtime_config