mirror of
https://github.com/PyratLabs/ansible-role-k3s.git
synced 2024-12-02 13:25:00 +01:00
22 lines
1013 B
YAML
22 lines
1013 B
YAML
---
|
|
|
|
- name: Check the conditions when a single controller is defined
|
|
assert:
|
|
that:
|
|
- (k3s_controller_count | length == 1)
|
|
and (k3s_datastore_endpoint is not defined or not k3s_datastore_endpoint)
|
|
and (k3s_dqlite_datastore is not defined or not k3s_dqlite_datastore)
|
|
success_msg: "Control plane configuration is valid."
|
|
fail_msg: "Control plane configuration is invalid. Please see notes about k3s_control_node and HA in README.md."
|
|
when: k3s_controller_count | length == 1
|
|
|
|
- name: Check the conditions when multiple controllers are defined
|
|
assert:
|
|
that:
|
|
- (k3s_controller_count | length >= 2)
|
|
and ((k3s_datastore_endpoint is defined and k3s_datastore_endpoint)
|
|
or k3s_dqlite_datastore is defined and k3s_dqlite_datastore)
|
|
success_msg: "Control plane configuration is valid."
|
|
fail_msg: "Control plane configuration is invalid. Please see notes about k3s_control_node and HA in README.md."
|
|
when: k3s_controller_count | length >= 2
|