upgrade.yml 1.6 KB

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