From 12d01c2a60b7e85466f2c4c8fc8eb5e36c4f598d Mon Sep 17 00:00:00 2001 From: Xan Manning Date: Thu, 27 Feb 2020 18:46:59 +0000 Subject: [PATCH] Added tests and variable validation --- molecule/default/playbook-no-deploy.yml | 3 +++ tasks/validate/check-variables.yml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/molecule/default/playbook-no-deploy.yml b/molecule/default/playbook-no-deploy.yml index 127fbf5..831b989 100644 --- a/molecule/default/playbook-no-deploy.yml +++ b/molecule/default/playbook-no-deploy.yml @@ -19,5 +19,8 @@ - hello: world k3s_node_taints: - key1: value1:NoExecute + k3s_kubelet_args: + - cloud-provider: external + - provider-id: azure roles: - role: xanmanning.k3s diff --git a/tasks/validate/check-variables.yml b/tasks/validate/check-variables.yml index 29a1f23..3999bec 100644 --- a/tasks/validate/check-variables.yml +++ b/tasks/validate/check-variables.yml @@ -118,6 +118,14 @@ fail_msg: "Node Taints are not supported in {{ k3s_release_version }}" when: k3s_node_taints is defined and k3s_node_taints +- name: Check k3s_kubelet_args against k3s version + assert: + that: + - (k3s_release_version | replace('v', '')) is version_compare('0.4.0', '>=') + success_msg: "Kubelet args supported in {{ k3s_release_version }}" + fail_msg: "Kubelet args are not supported in {{ k3s_release_version }}" + when: k3s_kubelet_args is defined and k3s_kubelet_args | length > 0 + - name: Check k3s_flannel_backend against k3s version assert: that: