9052 crio add dpkg hold (#9075)

* Update main.yaml

* remove version in dpkg_selection name

* make lint happy

* Fix typo

* add comment / remove useless contition

* remove dpkg hold in reset tasks
pull/9101/head
pil57852 2022-07-19 09:30:07 +02:00 committed by GitHub
parent 0d32c0d92b
commit 626ea64f66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -95,6 +95,16 @@
- ansible_distribution == "Debian"
- ansible_distribution_version == "10"
- name: Remove dpkg hold
dpkg_selections:
name: "{{ item | split ('=') | first }}"
selection: install
when:
- ansible_pkg_mgr == 'apt'
changed_when: false
with_items:
- "{{ crio_packages }}"
- name: Install cri-o packages
package:
name: "{{ item }}"
@ -106,6 +116,17 @@
retries: 4
delay: "{{ retry_stagger | d(3) }}"
# This is required to ensure any apt upgrade will not break kubernetes
- name: Tell Debian hosts not to change the cri-o version with apt upgrade
dpkg_selections:
name: "{{ item | split ('=') | first }}"
selection: hold
when:
- ansible_pkg_mgr == 'apt'
changed_when: false
with_items:
- "{{ crio_packages }}"
- name: Check if already installed
stat:
path: "/bin/crio"

View File

@ -81,6 +81,16 @@
tags:
- reset_crio
- name: CRI-O | Remove dpkg hold
dpkg_selections:
name: "{{ item }}"
selection: install
when: ansible_pkg_mgr == 'apt'
changed_when: false
with_items: "{{ crio_packages }}"
tags:
- reset_crio
- name: CRI-O | Uninstall CRI-O package
package:
name: "{{ item }}"