From 02e12e61a8c649fb9db7e407c5a6431416bc0c27 Mon Sep 17 00:00:00 2001 From: Xan Manning Date: Sun, 17 May 2020 20:43:39 +0100 Subject: [PATCH] Bugfix: minimum version for secrets encryption reverted --- molecule/highavailability/playbook-dqlite.yml | 1 + tasks/main.yml | 2 +- tasks/state-installed.yml | 2 ++ tasks/validate/check-environment.yml | 6 ++++++ tasks/validate/check-variables.yml | 4 ++-- 5 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 tasks/validate/check-environment.yml diff --git a/molecule/highavailability/playbook-dqlite.yml b/molecule/highavailability/playbook-dqlite.yml index 786caf7..e52a775 100644 --- a/molecule/highavailability/playbook-dqlite.yml +++ b/molecule/highavailability/playbook-dqlite.yml @@ -4,6 +4,7 @@ become: true vars: molecule_is_test: true + k3s_release_version: v1.18.2+k3s1 k3s_dqlite_datastore: true k3s_secrets_encryption: true k3s_use_experimental: true diff --git a/tasks/main.yml b/tasks/main.yml index e5d6678..10646b3 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,4 +8,4 @@ success_msg: "k3s_cluster_state is valid." when: k3s_cluster_state is defined -- import_tasks: state-{{ (k3s_cluster_state | lower) | default('installed') }}.yml +- include_tasks: state-{{ (k3s_cluster_state | lower) | default('installed') }}.yml diff --git a/tasks/state-installed.yml b/tasks/state-installed.yml index 011e520..109ae53 100644 --- a/tasks/state-installed.yml +++ b/tasks/state-installed.yml @@ -1,5 +1,7 @@ --- +- import_tasks: validate/check-environment.yml + - import_tasks: build/preconfigure-k3s.yml - import_tasks: build/get-version.yml diff --git a/tasks/validate/check-environment.yml b/tasks/validate/check-environment.yml new file mode 100644 index 0000000..0eb28b9 --- /dev/null +++ b/tasks/validate/check-environment.yml @@ -0,0 +1,6 @@ +--- + +- name: Check to see if jmespath is installed + command: echo "{{ (hostvars | json_query('*.k3s_control_node')) }}" + register: k3s_check_jmespath + changed_when: false diff --git a/tasks/validate/check-variables.yml b/tasks/validate/check-variables.yml index 3fab225..b9b26a7 100644 --- a/tasks/validate/check-variables.yml +++ b/tasks/validate/check-variables.yml @@ -137,7 +137,7 @@ - name: Check k3s_flannel_backend 'host-gw' configuration against k3s version assert: that: - - (k3s_release_version | replace('v', '')) is version_compare('1.16.9', '>=') + - (k3s_release_version | replace('v', '')) is version_compare('1.17.2', '>=') success_msg: "host-gw flannel backend supported in {{ k3s_release_version }}" fail_msg: "host-gw flannel backend is not supported in {{ k3s_release_version }}" when: k3s_flannel_backend is defined and k3s_flannel_backend == 'host-gw' @@ -217,7 +217,7 @@ - name: Check k3s_secrets_encryption against k3s version assert: that: - - (k3s_release_version | replace('v', '')) is version_compare('1.16.9', '>=') + - (k3s_release_version | replace('v', '')) is version_compare('1.17.4', '>=') success_msg: "Secrets encryption at rest supported in {{ k3s_release_version }}" fail_msg: "Secrets encryption at rest is not supported in {{ k3s_release_version }}" when: k3s_secrets_encryption is defined and k3s_secrets_encryption