From e457854046638d5e002e3083db28e407b48a747e Mon Sep 17 00:00:00 2001 From: Xan Manning Date: Mon, 20 Dec 2021 20:18:38 +0000 Subject: [PATCH] fix(validation): distribution and version for packages --- tasks/validate/main.yml | 4 ++-- vars/main.yml | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tasks/validate/main.yml b/tasks/validate/main.yml index b6bfc9f..1ee2a09 100644 --- a/tasks/validate/main.yml +++ b/tasks/validate/main.yml @@ -1,13 +1,13 @@ --- - include_tasks: environment/remote/packages.yml - loop: "{{ k3s_check_packages[ansible_distribution | replace(' ', '-') | lower] }}" + loop: "{{ k3s_check_packages[k3s_os_distribution_version] }}" loop_control: loop_var: package when: - not k3s_skip_validation - not k3s_skip_env_checks - - k3s_check_packages[ansible_distribution | replace(' ', '-') | lower] is defined + - k3s_check_packages[k3s_os_distribution_version] is defined - import_tasks: configuration/variables.yml diff --git a/vars/main.yml b/vars/main.yml index 2b4e28e..3622e14 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -91,12 +91,17 @@ k3s_server_manifests_dir: "{{ k3s_data_dir }}/server/manifests" # https://github.com/k3s-io/k3s/pull/1691 k3s_server_pod_manifests_dir: "{{ k3s_data_dir }}/agent/pod-manifests" +# OS formatted strings +k3s_os_distribution: "{{ ansible_distribution | replace(' ', '-') | lower }}" +k3s_os_version: "{{ ansible_distribution_version | replace([' ', '.'], '-') | lower }}" +k3s_os_distribution_version: "{{ k3s_os_distribution }}-{{ k3s_os_version }}" + # Packages that we need to check are installed k3s_check_packages: - debian: - - name: iptables + debian-11: + - name: iptables-legacy from: 1.19.2 - until: 1.22.2 + # until: 1.22.2 documentation: https://rancher.com/docs/k3s/latest/en/advanced/#enabling-legacy-iptables-on-raspbian-buster # - name: dummy # from: 1.19.2