fix(validation): distribution and version for packages

This commit is contained in:
Xan Manning 2021-12-20 20:18:38 +00:00 committed by Curtis John
parent cc8ba00de2
commit e457854046
2 changed files with 10 additions and 5 deletions

View File

@ -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

View File

@ -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