upgrade.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ---
  2. # input variables:
  3. # - l_docker_upgrade
  4. # - openshift_is_atomic
  5. # - node_config_hook
  6. # - openshift_pkg_version
  7. # - openshift_is_containerized
  8. # - openshift_release
  9. # tasks file for openshift_node_upgrade
  10. - name: stop services for upgrade
  11. import_tasks: upgrade/stop_services.yml
  12. # Ensure actually install latest package.
  13. - name: install docker upgrade rpm
  14. command: "{{ ansible_pkg_mgr }} install -y docker{{ '-' + docker_version }}"
  15. register: result
  16. until: result is succeeded
  17. when:
  18. - l_docker_upgrade is defined
  19. - l_docker_upgrade | bool
  20. - name: install pre-pulled rpms.
  21. import_tasks: upgrade/rpm_upgrade_install.yml
  22. vars:
  23. openshift_version: "{{ openshift_pkg_version | default('') }}"
  24. when: not openshift_is_containerized | bool
  25. - include_tasks: "{{ node_config_hook }}"
  26. when: node_config_hook is defined
  27. - import_tasks: upgrade/config_changes.yml
  28. - import_tasks: dnsmasq_install.yml
  29. - import_tasks: dnsmasq.yml
  30. # Restart all services
  31. - import_tasks: upgrade/restart.yml
  32. - name: Wait for node to be ready
  33. oc_obj:
  34. state: list
  35. kind: node
  36. name: "{{ openshift.common.hostname | lower }}"
  37. register: node_output
  38. delegate_to: "{{ groups.oo_first_master.0 }}"
  39. until: node_output.results.returncode == 0 and node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
  40. # Give the node two minutes to come back online.
  41. retries: 24
  42. delay: 5
  43. - import_tasks: journald.yml
  44. - meta: flush_handlers