feat(validate): package check for iptables on debian

This commit is contained in:
Xan Manning 2021-12-19 21:41:59 +00:00
parent 09abfd2cba
commit 1eaeba67b5
11 changed files with 39 additions and 18 deletions

View File

@ -3,8 +3,10 @@
hosts: node*
become: true
tasks:
- name: Ensure apt cache is updated
- name: Ensure apt cache is updated and iptables is installed
ansible.builtin.apt:
name: iptables
state: present
update_cache: true
when: ansible_pkg_mgr == 'apt'

View File

@ -2,7 +2,9 @@
- name: Prepare
hosts: all
tasks:
- name: Ensure apt cache is updated
- name: Ensure apt cache is updated and iptables is installed
ansible.builtin.apt:
name: iptables
state: present
update_cache: true
when: ansible_pkg_mgr == 'apt'

View File

@ -2,7 +2,9 @@
- name: Prepare
hosts: all
tasks:
- name: Ensure apt cache is updated
- name: Ensure apt cache is updated and iptables is installed
ansible.builtin.apt:
name: iptables
state: present
update_cache: true
when: ansible_pkg_mgr == 'apt'

View File

@ -2,7 +2,9 @@
- name: Prepare
hosts: all
tasks:
- name: Ensure apt cache is updated
- name: Ensure apt cache is updated and iptables is installed
ansible.builtin.apt:
name: iptables
state: present
update_cache: true
when: ansible_pkg_mgr == 'apt'

View File

@ -33,8 +33,10 @@
- name: Prepare nodes
hosts: node*
tasks:
- name: Ensure apt cache is updated
- name: Ensure apt cache is updated and iptables is installed
ansible.builtin.apt:
name: iptables
state: present
update_cache: true
when: ansible_pkg_mgr == 'apt'

View File

@ -33,8 +33,10 @@
- name: Prepare nodes
hosts: node*
tasks:
- name: Ensure apt cache is updated
- name: Ensure apt cache is updated and iptables is installed
ansible.builtin.apt:
name: iptables
state: present
update_cache: true
when: ansible_pkg_mgr == 'apt'

View File

@ -2,7 +2,9 @@
- name: Prepare
hosts: all
tasks:
- name: Ensure apt cache is updated
- name: Ensure apt cache is updated and iptables is installed
ansible.builtin.apt:
name: iptables
state: present
update_cache: true
when: ansible_pkg_mgr == 'apt'

View File

@ -18,7 +18,8 @@
Documentation: {{ package.documentation }}
{% endif %}
when:
- check_k3s_required_package.rc is defined
- (package.until is not defined
or k3s_release_version is version_compare(package.until, '>='))
or (k3s_release_version | replace('v', '')) is version_compare(package.until, '>='))
- (package.from is not defined
or k3s_release_version is version_compare(package.from, '>='))
or (k3s_release_version | replace('v', '')) is version_compare(package.from, '>='))

View File

@ -1,5 +1,14 @@
---
- include_tasks: environment/remote/packages.yml
loop: "{{ k3s_check_packages[ansible_distribution | replace(' ', '-') | lower] }}"
loop_control:
loop_var: package
when:
- not k3s_skip_validation
- not k3s_skip_env_checks
- k3s_check_packages[ansible_distribution | replace(' ', '-') | lower] is defined
- import_tasks: configuration/variables.yml
- import_tasks: configuration/experimental-variables.yml

View File

@ -21,14 +21,6 @@
- not k3s_skip_validation
- not k3s_skip_env_checks
- include_tasks: environment/remote/packages.yml
loop: "{{ k3s_check_packages }}"
loop_control:
loop_var: package
when:
- not k3s_skip_validation
- not k3s_skip_env_checks
- include_tasks: environment/local/issue-data.yml
when:
- pyratlabs_issue_controller_dump is defined

View File

@ -89,7 +89,12 @@ k3s_server_manifests_dir: "{{ k3s_data_dir }}/server/manifests"
k3s_server_pod_manifests_dir: "{{ k3s_data_dir }}/agent/pod-manifests"
# Packages that we need to check are installed
k3s_check_packages: []
k3s_check_packages:
debian:
- name: iptables
from: 1.19.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
# until: 1.21.0