upgrade.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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: "{{ pkg_list | join (',') }}"
  22. state: latest
  23. when:
  24. - openshift_use_crio | bool
  25. register: crio_update
  26. until: crio_update is succeeded
  27. vars:
  28. pkg_list:
  29. - cri-o
  30. - cri-tools
  31. - name: Remove CRI-O default configuration files
  32. file:
  33. path: "{{ item }}"
  34. state: absent
  35. with_items:
  36. - "/etc/cni/net.d/200-loopback.conf"
  37. - "/etc/cni/net.d/100-crio-bridge.conf"
  38. when: crio_update is changed
  39. - name: Ensure crictl.yaml runtime-endpoint is updated
  40. yedit:
  41. src: /etc/crictl.yaml
  42. key: runtime-endpoint
  43. value: "{{ openshift_crio_var_sock }}"
  44. when:
  45. - openshift_use_crio | default(False) | bool
  46. - name: install pre-pulled rpms.
  47. import_tasks: upgrade/rpm_upgrade_install.yml
  48. when: not openshift_is_atomic | bool
  49. # TODO(michaelgugino): Remove in 3.12
  50. - import_tasks: selinux_container_cgroup.yml
  51. - include_tasks: "{{ node_config_hook }}"
  52. when: node_config_hook is defined
  53. - import_tasks: upgrade/config_changes.yml
  54. - import_tasks: dnsmasq_install.yml
  55. - import_tasks: dnsmasq.yml
  56. # Restart all services
  57. - import_tasks: upgrade/restart.yml
  58. - name: Approve node certificates when bootstrapping
  59. oc_csr_approve:
  60. oc_bin: "{{ hostvars[groups.oo_first_master.0]['first_master_client_binary'] }}"
  61. oc_conf: "{{ openshift.common.config_base }}/master/admin.kubeconfig"
  62. node_list:
  63. - "{{ openshift.node.nodename | lower }}"
  64. delegate_to: "{{ groups.oo_first_master.0 }}"
  65. register: node_upgrade_oc_csr_approve
  66. retries: 30
  67. until: node_upgrade_oc_csr_approve is succeeded
  68. - import_tasks: journald.yml
  69. - meta: flush_handlers