preinstall: use package instead of action, use state: present

Before this commit we were upgrading base os packages on each run

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
(cherry picked from commit 4eec302e86)
This commit is contained in:
Etienne Champetier 2021-01-09 16:49:18 -05:00 committed by Kubernetes Prow Robot
parent a652a3b3b5
commit 803f89e82b

View file

@ -40,7 +40,7 @@
- bootstrap-os - bootstrap-os
- name: Install epel-release on RedHat/CentOS - name: Install epel-release on RedHat/CentOS
yum: package:
name: epel-release name: epel-release
state: present state: present
when: when:
@ -56,10 +56,9 @@
when: kube_proxy_mode == 'ipvs' when: kube_proxy_mode == 'ipvs'
- name: Install packages requirements - name: Install packages requirements
action: package:
module: "{{ ansible_pkg_mgr }}"
name: "{{ required_pkgs | default([]) | union(common_required_pkgs|default([])) }}" name: "{{ required_pkgs | default([]) | union(common_required_pkgs|default([])) }}"
state: latest state: present
register: pkgs_task_result register: pkgs_task_result
until: pkgs_task_result is succeeded until: pkgs_task_result is succeeded
retries: "{{ pkg_install_retries }}" retries: "{{ pkg_install_retries }}"
@ -69,7 +68,7 @@
- bootstrap-os - bootstrap-os
- name: Install ipvsadm for ClearLinux - name: Install ipvsadm for ClearLinux
swupd: package:
name: ipvsadm name: ipvsadm
state: present state: present
when: when: