c12s-kubespray/roles/kubernetes/preinstall/tasks/0070-system-packages.yml

78 lines
2.1 KiB
YAML
Raw Normal View History

2018-09-06 14:26:57 +00:00
---
2018-08-23 14:51:52 +00:00
- name: Update package management cache (zypper) - SUSE
shell: zypper -n --gpg-auto-import-keys ref
register: make_cache_output
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
- name: Update package management cache (APT)
apt:
update_cache: yes
cache_valid_time: 3600
when: ansible_os_family == "Debian"
tags:
- bootstrap-os
Backport remove dockerproject (#5682) (#5780) * Remove dockerproject org (#5548) * Change dockerproject.org to download.docker.com dockerproject.org was deprecated in 2017 and has gone down. * Restore yum repo for containerd Change-Id: I883bb512a2164a85865b1bd4fb569af0358c8c2b Co-authored-by: Craig Rodrigues <rodrigc@crodrigues.org> * remove legacy docker repo in kubernetes/preinstall before any packages installed (#5640) * Remove dockerproject_.+_repo_.+ variables (#5662) This 38688a44866d5ee612f80c16ef81e135d1347653 change replaces the value for dockerproject_.+_repo_.+ docker variables but their new value was previously defined in other variables. This change removes the dockerproject_.+_repo_.+ docker variables in favor of the older ones. * Remove stale legacy yum docker repo /etc/yum.repos.d/docker.repo (#5569) * Remove stale legacy yum docker repo /etc/yum.repos.d/docker.repo * move task 'Remove legacy docker repo file' to pre-upgrade.yml * fix upgrade procedure when in playbook (#5695) exists role kubernetes/preinstall and not exists role container-engine error 'yum_repo_dir' is undefined Co-authored-by: Matthew Mosesohn <matthew.mosesohn@gmail.com> Co-authored-by: Craig Rodrigues <rodrigc@crodrigues.org> Co-authored-by: Victor Morales <chipahuac@hotmail.com> Co-authored-by: Kubernetes Prow Robot <k8s-ci-robot@users.noreply.github.com> Co-authored-by: Matthew Mosesohn <matthew.mosesohn@gmail.com> Co-authored-by: Craig Rodrigues <rodrigc@crodrigues.org> Co-authored-by: Victor Morales <chipahuac@hotmail.com>
2020-03-17 14:38:22 +00:00
- name: Remove legacy docker repo file
file:
path: "{{ yum_repo_dir }}/docker.repo"
state: absent
when:
- ansible_distribution in ["CentOS","RedHat","OracleLinux"]
- not is_atomic
2018-08-23 14:51:52 +00:00
- name: Install python-dnf for latest RedHat versions
command: dnf install -y python-dnf yum
register: dnf_task_result
until: dnf_task_result is succeeded
2018-08-23 14:51:52 +00:00
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
when:
- ansible_distribution == "Fedora"
- ansible_distribution_major_version|int > 21
- not is_atomic
changed_when: False
tags:
- bootstrap-os
- name: Install epel-release on RedHat/CentOS
yum:
name: epel-release
state: present
when:
- ansible_distribution in ["CentOS","RedHat"]
- not is_atomic
- epel_enabled|bool
tags:
- bootstrap-os
- name: Update common_required_pkgs with ipvsadm when kube_proxy_mode is ipvs
set_fact:
common_required_pkgs: "{{ common_required_pkgs|default([]) + ['ipvsadm', 'ipset'] }}"
when: kube_proxy_mode == 'ipvs'
2018-08-23 14:51:52 +00:00
- name: Install packages requirements
action:
module: "{{ ansible_pkg_mgr }}"
name: "{{ required_pkgs | default([]) | union(common_required_pkgs|default([])) }}"
2018-08-23 14:51:52 +00:00
state: latest
register: pkgs_task_result
until: pkgs_task_result is succeeded
2018-08-23 14:51:52 +00:00
retries: 4
delay: "{{ retry_stagger | random + 3 }}"
when: not (ansible_os_family in ["CoreOS", "Container Linux by CoreOS", "ClearLinux"] or is_atomic)
2018-08-23 14:51:52 +00:00
tags:
- bootstrap-os
- name: Install ipvsadm for ClearLinux
swupd:
name: ipvsadm
state: present
when:
- ansible_os_family in ["ClearLinux"]
- kube_proxy_mode == 'ipvs'