upgrade.yml 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 | bool
  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 is changed
  38. - name: Ensure crictl.yaml runtime-endpoint is updated
  39. yedit:
  40. src: /etc/crictl.yaml
  41. key: runtime-endpoint
  42. value: "{{ openshift_crio_var_sock }}"
  43. when:
  44. - openshift_use_crio | default(False) | bool
  45. - name: install pre-pulled rpms.
  46. import_tasks: upgrade/rpm_upgrade_install.yml
  47. when: not openshift_is_atomic | bool
  48. # TODO(michaelgugino): Remove in 3.12
  49. - import_tasks: selinux_container_cgroup.yml
  50. - include_tasks: "{{ node_config_hook }}"
  51. when: node_config_hook is defined
  52. - import_tasks: upgrade/config_changes.yml
  53. - import_tasks: dnsmasq_install.yml
  54. - import_tasks: dnsmasq.yml
  55. # Restart all services
  56. - import_tasks: upgrade/restart.yml
  57. - name: Approve node certificates when bootstrapping
  58. oc_csr_approve:
  59. oc_bin: "{{ hostvars[groups.oo_first_master.0]['first_master_client_binary'] }}"
  60. oc_conf: "{{ openshift.common.config_base }}/master/admin.kubeconfig"
  61. node_list:
  62. - "{{ openshift.node.nodename | lower }}"
  63. delegate_to: "{{ groups.oo_first_master.0 }}"
  64. register: node_upgrade_oc_csr_approve
  65. retries: 30
  66. until: node_upgrade_oc_csr_approve is succeeded
  67. - import_tasks: journald.yml
  68. - meta: flush_handlers