upgrade_pre.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. ---
  2. # This is a hack to allow us to update various components without restarting
  3. # services. This will persist into the upgrade play as well, so everything
  4. # needs to be restarted by hand.
  5. - set_fact:
  6. skip_node_svc_handlers: True
  7. - import_tasks: registry_auth.yml
  8. - name: Check that pod image is present
  9. command: "{{ openshift_container_cli }} images -q {{ osn_pod_image }}"
  10. register: pod_image
  11. # This task runs async to save time while other downloads proceed
  12. - name: pre-pull pod image
  13. docker_image:
  14. name: "{{ osn_pod_image }}"
  15. environment:
  16. NO_PROXY: "{{ openshift.common.no_proxy | default('') }}"
  17. when: pod_image.stdout_lines == []
  18. # 10 minutes to pull the image
  19. async: 600
  20. poll: 0
  21. register: pod_image_prepull
  22. - name: update package meta data to speed install later.
  23. command: "{{ ansible_pkg_mgr }} makecache"
  24. register: result
  25. until: result is succeeded
  26. when: not openshift_is_atomic | bool
  27. # Prepull the rpms for docker upgrade, but don't install
  28. - name: download docker upgrade rpm
  29. command: "{{ ansible_pkg_mgr }} install -y --downloadonly docker{{ '-' + docker_version }}"
  30. register: result
  31. until: result is succeeded
  32. when:
  33. - l_docker_upgrade is defined
  34. - l_docker_upgrade | bool
  35. - name: Stage cri-o updates
  36. command: "{{ ansible_pkg_mgr }} install -y --downloadonly {{ crio_pkgs | join(' ') }}"
  37. register: result
  38. until: result is succeeded
  39. when:
  40. - openshift_use_crio | bool
  41. vars:
  42. crio_pkgs:
  43. - "cri-o"
  44. - "cri-tools"
  45. - import_tasks: upgrade/rpm_upgrade.yml
  46. when: not openshift_is_atomic | bool
  47. - name: Check status of node pod image pre-pull
  48. async_status:
  49. jid: "{{ pod_image_prepull.ansible_job_id }}"
  50. register: job_result
  51. until: job_result.finished
  52. when: pod_image.stdout_lines == []
  53. retries: 20
  54. delay: 30
  55. failed_when: false