upgrade.yml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. when: not openshift_is_containerized | bool
  23. - include_tasks: "{{ node_config_hook }}"
  24. when: node_config_hook is defined
  25. - import_tasks: upgrade/config_changes.yml
  26. - import_tasks: dnsmasq_install.yml
  27. - import_tasks: dnsmasq.yml
  28. # Restart all services
  29. - import_tasks: upgrade/restart.yml
  30. - name: Approve node certificates when bootstrapping
  31. oc_adm_csr:
  32. nodes: "{{ openshift.node.nodename | lower }}"
  33. timeout: 180
  34. fail_on_timeout: true
  35. delegate_to: "{{ groups.oo_first_master.0 }}"
  36. ignore_errors: true
  37. - name: Wait for node to be ready
  38. oc_obj:
  39. state: list
  40. kind: node
  41. name: "{{ openshift.node.nodename | lower }}"
  42. register: node_output
  43. delegate_to: "{{ groups.oo_first_master.0 }}"
  44. until: node_output.results.returncode == 0 and node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
  45. # Give the node three minutes to come back online.
  46. retries: 36
  47. delay: 5
  48. - import_tasks: journald.yml
  49. - meta: flush_handlers