upgrade.yml 1.9 KB

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