diff --git a/roles/bootstrap_os/tasks/opensuse.yml b/roles/bootstrap_os/tasks/opensuse.yml index 5a4f9dead..796801958 100644 --- a/roles/bootstrap_os/tasks/opensuse.yml +++ b/roles/bootstrap_os/tasks/opensuse.yml @@ -55,31 +55,3 @@ become: true tags: - facts - -# Without this package, the get_url module fails when trying to handle https -- name: Install python-cryptography - community.general.zypper: - name: python-cryptography - state: present - update_cache: true - become: true - when: - - ansible_distribution_version is version('15.4', '<') - -- name: Install python3-cryptography - community.general.zypper: - name: python3-cryptography - state: present - update_cache: true - become: true - when: - - ansible_distribution_version is version('15.4', '>=') - -# Nerdctl needs some basic packages to get an environment up -- name: Install basic dependencies - community.general.zypper: - name: - - iptables - - apparmor-parser - state: present - become: true diff --git a/roles/system_packages/tasks/main.yml b/roles/system_packages/tasks/main.yml index 909110b6e..269c4bc03 100644 --- a/roles/system_packages/tasks/main.yml +++ b/roles/system_packages/tasks/main.yml @@ -69,7 +69,8 @@ package: name: "{{ item.packages | dict2items | selectattr('value', 'ansible.builtin.all') | map(attribute='key') }}" state: "{{ item.state }}" - update_cache: true + update_cache: "{{ true if ansible_pkg_mgr in ['zypper', 'apt', 'dnf'] else omit }}" + cache_valid_time: "{{ 86400 if ansible_pkg_mgr == 'apt' else omit }}" # 24h register: pkgs_task_result until: pkgs_task_result is succeeded retries: "{{ pkg_install_retries }}" diff --git a/roles/system_packages/vars/main.yml b/roles/system_packages/vars/main.yml index c07f70bfc..90cf120cb 100644 --- a/roles/system_packages/vars/main.yml +++ b/roles/system_packages/vars/main.yml @@ -7,6 +7,8 @@ pkgs_to_remove: pkgs: apparmor: - "{{ ansible_os_family == 'Debian' }}" + apparmor-parser: + - "{{ ansible_os_family == 'Suse' }}" apt-transport-https: - "{{ ansible_os_family == 'Debian' }}" aufs-tools: @@ -51,7 +53,7 @@ pkgs: - "{{ kube_proxy_mode != 'ipvs' }}" - "{{ 'k8s_cluster' in group_names }}" iptables: - - "{{ ansible_os_family in ['Debian', 'RedHat'] }}" + - "{{ ansible_os_family in ['Debian', 'RedHat', 'Suse'] }}" iputils: - "{{ not ansible_os_family in ['Flatcar', 'Flatcar Container Linux by Kinvolk', 'Debian'] }}" - "{{ main_access_ip is defined }}" @@ -91,9 +93,15 @@ pkgs: python-apt: - "{{ ansible_os_family == 'Debian' }}" - "{{ ansible_distribution_major_version == '10' }}" + python-cryptography: + - "{{ ansible_os_family == 'Suse' }}" + - "{{ ansible_distribution_version is version('15.4', '<') }}" python3-apt: - "{{ ansible_os_family == 'Debian' }}" - "{{ ansible_distribution_major_version != '10' }}" + python3-cryptography: + - "{{ ansible_os_family == 'Suse' }}" + - "{{ ansible_distribution_version is version('15.4', '>=') }}" python3-libselinux: - "{{ ansible_distribution in ['RedHat', 'CentOS'] }}" rsync: [] diff --git a/scripts/assert-sorted-checksums.yml b/scripts/assert-sorted-checksums.yml index d7e2e86db..904abdf10 100755 --- a/scripts/assert-sorted-checksums.yml +++ b/scripts/assert-sorted-checksums.yml @@ -48,6 +48,7 @@ ansible_distribution: irrelevant ansible_distribution_major_version: irrelevant ansible_distribution_minor_version: irrelevant + ansible_distribution_version: 1.0 ansible_os_family: irrelevant assert: that: "pkgs_lists | sort == pkgs_lists"