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