Browse Source

Merge pull request #8628 from sdodson/upgrade-crio

Upgrade cri-o during node upgrade
Scott Dodson 6 years ago
parent
commit
a9630806c0
2 changed files with 23 additions and 0 deletions
  1. 16 0
      roles/openshift_node/tasks/upgrade.yml
  2. 7 0
      roles/openshift_node/tasks/upgrade_pre.yml

+ 16 - 0
roles/openshift_node/tasks/upgrade.yml

@@ -20,6 +20,22 @@
   - l_docker_upgrade is defined
   - l_docker_upgrade | bool
 
+- name: Ensure cri-o is updated
+  package:
+    name: cri-o
+    state: latest
+  when:
+  - openshift_use_crio | default(False)
+  register: crio_update
+
+- name: Restart cri-o
+  systemd:
+    name: cri-o
+    state: restarted
+  when:
+  - openshift_use_crio | default(False)
+  - crio_update is changed
+
 - name: install pre-pulled rpms.
   import_tasks: upgrade/rpm_upgrade_install.yml
   when: not openshift_is_atomic | bool

+ 7 - 0
roles/openshift_node/tasks/upgrade_pre.yml

@@ -34,5 +34,12 @@
   - l_docker_upgrade is defined
   - l_docker_upgrade | bool
 
+- name: Stage cri-o updates
+  command: "{{ ansible_pkg_mgr }} install -y --downloadonly cri-o"
+  register: result
+  until: result is succeeded
+  when:
+  - openshift_use_crio | default(False)
+
 - import_tasks: upgrade/rpm_upgrade.yml
   when: not openshift_is_atomic | bool