upgrade.yml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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: Ensure cri-o is updated
  20. package:
  21. name: "{{ crio_pkgs | join (',') }}"
  22. state: latest
  23. when:
  24. - openshift_use_crio | default(False)
  25. register: crio_update
  26. vars:
  27. crio_pkgs:
  28. - "cri-o"
  29. - "cri-tools"
  30. - name: Remove CRI-O default configuration files
  31. file:
  32. path: "{{ item }}"
  33. state: absent
  34. with_items:
  35. - "/etc/cni/net.d/200-loopback.conf"
  36. - "/etc/cni/net.d/100-crio-bridge.conf"
  37. when: crio_update | changed
  38. - name: install pre-pulled rpms.
  39. import_tasks: upgrade/rpm_upgrade_install.yml
  40. when: not openshift_is_atomic | bool
  41. - include_tasks: "{{ node_config_hook }}"
  42. when: node_config_hook is defined
  43. - import_tasks: upgrade/config_changes.yml
  44. - import_tasks: dnsmasq_install.yml
  45. - import_tasks: dnsmasq.yml
  46. # Restart all services
  47. - import_tasks: upgrade/restart.yml
  48. - name: Approve node certificates when bootstrapping
  49. oc_adm_csr:
  50. nodes: "{{ openshift.node.nodename | lower }}"
  51. timeout: 180
  52. fail_on_timeout: true
  53. delegate_to: "{{ groups.oo_first_master.0 }}"
  54. ignore_errors: true
  55. - name: Wait for node to be ready
  56. oc_obj:
  57. state: list
  58. kind: node
  59. name: "{{ openshift.node.nodename | lower }}"
  60. register: node_output
  61. delegate_to: "{{ groups.oo_first_master.0 }}"
  62. until:
  63. - node_output.results is defined
  64. - node_output.results.returncode is defined
  65. - node_output.results.results is defined
  66. - node_output.results.returncode == 0
  67. - node_output.results.results[0].status.conditions | selectattr('type', 'match', '^Ready$') | map(attribute='status') | join | bool == True
  68. # Give the node three minutes to come back online.
  69. retries: 36
  70. delay: 5
  71. - import_tasks: journald.yml
  72. - meta: flush_handlers