2018-09-06 14:26:57 +00:00
|
|
|
---
|
2020-07-28 08:39:08 +00:00
|
|
|
- name: Update package management cache (zypper) - SUSE
|
|
|
|
command: zypper -n --gpg-auto-import-keys ref
|
2018-08-23 14:51:52 +00:00
|
|
|
register: make_cache_output
|
2018-10-16 22:33:30 +00:00
|
|
|
until: make_cache_output is succeeded
|
2018-08-23 14:51:52 +00:00
|
|
|
retries: 4
|
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
|
|
|
when:
|
|
|
|
- ansible_pkg_mgr == 'zypper'
|
|
|
|
tags: bootstrap-os
|
|
|
|
|
2022-10-19 12:47:05 +00:00
|
|
|
- block:
|
|
|
|
- name: Add Debian Backports apt repo
|
|
|
|
apt_repository:
|
|
|
|
repo: "deb http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main"
|
|
|
|
state: present
|
|
|
|
filename: debian-backports
|
|
|
|
|
|
|
|
- name: Set libseccomp2 pin priority to apt_preferences on Debian buster
|
|
|
|
copy:
|
|
|
|
content: |
|
|
|
|
Package: libseccomp2
|
|
|
|
Pin: release a={{ ansible_distribution_release }}-backports
|
|
|
|
Pin-Priority: 1001
|
|
|
|
dest: "/etc/apt/preferences.d/libseccomp2"
|
|
|
|
owner: "root"
|
|
|
|
mode: 0644
|
|
|
|
when:
|
|
|
|
- ansible_distribution == "Debian"
|
|
|
|
- ansible_distribution_version == "10"
|
|
|
|
tags:
|
|
|
|
- bootstrap-os
|
|
|
|
|
2018-08-23 14:51:52 +00:00
|
|
|
- name: Update package management cache (APT)
|
|
|
|
apt:
|
|
|
|
update_cache: yes
|
|
|
|
cache_valid_time: 3600
|
|
|
|
when: ansible_os_family == "Debian"
|
|
|
|
tags:
|
|
|
|
- bootstrap-os
|
|
|
|
|
2020-02-17 16:59:28 +00:00
|
|
|
- name: Remove legacy docker repo file
|
|
|
|
file:
|
|
|
|
path: "{{ yum_repo_dir }}/docker.repo"
|
|
|
|
state: absent
|
|
|
|
when:
|
2021-04-23 06:50:03 +00:00
|
|
|
- ansible_os_family == "RedHat"
|
2020-03-17 10:12:21 +00:00
|
|
|
- not is_fedora_coreos
|
2020-02-17 16:59:28 +00:00
|
|
|
|
2019-10-17 12:04:38 +00:00
|
|
|
- name: Install python3-dnf for latest RedHat versions
|
|
|
|
command: dnf install -y python3-dnf
|
|
|
|
register: dnf_task_result
|
|
|
|
until: dnf_task_result is succeeded
|
|
|
|
retries: 4
|
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
|
|
|
when:
|
|
|
|
- ansible_distribution == "Fedora"
|
|
|
|
- ansible_distribution_major_version|int >= 30
|
2020-03-17 10:12:21 +00:00
|
|
|
- not is_fedora_coreos
|
2018-08-23 14:51:52 +00:00
|
|
|
changed_when: False
|
|
|
|
tags:
|
|
|
|
- bootstrap-os
|
|
|
|
|
2021-04-23 06:50:03 +00:00
|
|
|
- name: Install epel-release on RHEL derivatives
|
2021-01-09 21:49:18 +00:00
|
|
|
package:
|
2018-08-23 14:51:52 +00:00
|
|
|
name: epel-release
|
|
|
|
state: present
|
|
|
|
when:
|
2021-04-23 06:50:03 +00:00
|
|
|
- ansible_os_family == "RedHat"
|
2020-03-17 10:12:21 +00:00
|
|
|
- not is_fedora_coreos
|
2018-08-23 14:51:52 +00:00
|
|
|
- epel_enabled|bool
|
|
|
|
tags:
|
|
|
|
- bootstrap-os
|
|
|
|
|
2018-11-07 22:04:11 +00:00
|
|
|
- name: Update common_required_pkgs with ipvsadm when kube_proxy_mode is ipvs
|
|
|
|
set_fact:
|
2019-07-09 12:41:59 +00:00
|
|
|
common_required_pkgs: "{{ common_required_pkgs|default([]) + ['ipvsadm', 'ipset'] }}"
|
2018-11-07 22:04:11 +00:00
|
|
|
when: kube_proxy_mode == 'ipvs'
|
|
|
|
|
2018-08-23 14:51:52 +00:00
|
|
|
- name: Install packages requirements
|
2021-01-09 21:49:18 +00:00
|
|
|
package:
|
2019-01-31 22:57:22 +00:00
|
|
|
name: "{{ required_pkgs | default([]) | union(common_required_pkgs|default([])) }}"
|
2021-01-09 21:49:18 +00:00
|
|
|
state: present
|
2018-08-23 14:51:52 +00:00
|
|
|
register: pkgs_task_result
|
2018-10-16 22:33:30 +00:00
|
|
|
until: pkgs_task_result is succeeded
|
2020-11-23 07:47:35 +00:00
|
|
|
retries: "{{ pkg_install_retries }}"
|
2018-08-23 14:51:52 +00:00
|
|
|
delay: "{{ retry_stagger | random + 3 }}"
|
2021-10-01 16:11:23 +00:00
|
|
|
when: not (ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk", "ClearLinux"] or is_fedora_coreos)
|
2018-08-23 14:51:52 +00:00
|
|
|
tags:
|
|
|
|
- bootstrap-os
|
2018-12-18 09:39:25 +00:00
|
|
|
|
|
|
|
- name: Install ipvsadm for ClearLinux
|
2021-01-09 21:49:18 +00:00
|
|
|
package:
|
2018-12-18 09:39:25 +00:00
|
|
|
name: ipvsadm
|
|
|
|
state: present
|
|
|
|
when:
|
|
|
|
- ansible_os_family in ["ClearLinux"]
|
|
|
|
- kube_proxy_mode == 'ipvs'
|