Browse Source

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 2 years ago
committed by GitHub
parent
commit
626ea64f66
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions
  1. 21
      roles/container-engine/cri-o/tasks/main.yaml
  2. 10
      roles/container-engine/cri-o/tasks/reset.yml

21
roles/container-engine/cri-o/tasks/main.yaml

@ -95,6 +95,16 @@
- ansible_distribution == "Debian" - ansible_distribution == "Debian"
- ansible_distribution_version == "10" - 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 - name: Install cri-o packages
package: package:
name: "{{ item }}" name: "{{ item }}"
@ -106,6 +116,17 @@
retries: 4 retries: 4
delay: "{{ retry_stagger | d(3) }}" 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 - name: Check if already installed
stat: stat:
path: "/bin/crio" path: "/bin/crio"

10
roles/container-engine/cri-o/tasks/reset.yml

@ -81,6 +81,16 @@
tags: tags:
- reset_crio - 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 - name: CRI-O | Uninstall CRI-O package
package: package:
name: "{{ item }}" name: "{{ item }}"

Loading…
Cancel
Save