upgrade.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. ---
  2. #
  3. # Full Control Plane + Nodes Upgrade
  4. #
  5. - include: ../init.yml
  6. tags:
  7. - pre_upgrade
  8. - name: Configure the upgrade target for the common upgrade tasks
  9. hosts: oo_all_hosts
  10. tags:
  11. - pre_upgrade
  12. tasks:
  13. - set_fact:
  14. openshift_upgrade_target: "{{ '1.5' if deployment_type == 'origin' else '3.5' }}"
  15. openshift_upgrade_min: "{{ '1.4' if deployment_type == 'origin' else '3.4' }}"
  16. # Pre-upgrade
  17. - include: ../initialize_nodes_to_upgrade.yml
  18. tags:
  19. - pre_upgrade
  20. - name: Update repos and initialize facts on all hosts
  21. hosts: oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config:oo_lb_to_config
  22. tags:
  23. - pre_upgrade
  24. roles:
  25. - openshift_repos
  26. - name: Set openshift_no_proxy_internal_hostnames
  27. hosts: oo_masters_to_config:oo_nodes_to_upgrade
  28. tags:
  29. - pre_upgrade
  30. tasks:
  31. - set_fact:
  32. openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
  33. | union(groups['oo_masters_to_config'])
  34. | union(groups['oo_etcd_to_config'] | default([])))
  35. | oo_collect('openshift.common.hostname') | default([]) | join (',')
  36. }}"
  37. when: "{{ (openshift_http_proxy is defined or openshift_https_proxy is defined) and
  38. openshift_generate_no_proxy_hosts | default(True) | bool }}"
  39. - include: ../pre/verify_inventory_vars.yml
  40. tags:
  41. - pre_upgrade
  42. - include: ../disable_master_excluders.yml
  43. tags:
  44. - pre_upgrade
  45. - include: ../disable_node_excluders.yml
  46. tags:
  47. - pre_upgrade
  48. - include: ../../initialize_openshift_version.yml
  49. tags:
  50. - pre_upgrade
  51. vars:
  52. # Request specific openshift_release and let the openshift_version role handle converting this
  53. # to a more specific version, respecting openshift_image_tag and openshift_pkg_version if
  54. # defined, and overriding the normal behavior of protecting the installed version
  55. openshift_release: "{{ openshift_upgrade_target }}"
  56. openshift_protect_installed_version: False
  57. # We skip the docker role at this point in upgrade to prevent
  58. # unintended package, container, or config upgrades which trigger
  59. # docker restarts. At this early stage of upgrade we can assume
  60. # docker is configured and running.
  61. skip_docker_role: True
  62. - include: ../pre/verify_control_plane_running.yml
  63. tags:
  64. - pre_upgrade
  65. - include: ../../../openshift-master/validate_restart.yml
  66. tags:
  67. - pre_upgrade
  68. - name: Verify upgrade targets
  69. hosts: oo_masters_to_config:oo_nodes_to_upgrade
  70. tasks:
  71. - include: ../pre/verify_upgrade_targets.yml
  72. tags:
  73. - pre_upgrade
  74. - name: Verify docker upgrade targets
  75. hosts: oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config
  76. tasks:
  77. - include: ../pre/verify_docker_upgrade_targets.yml
  78. tags:
  79. - pre_upgrade
  80. - include: validator.yml
  81. tags:
  82. - pre_upgrade
  83. - include: ../pre/gate_checks.yml
  84. tags:
  85. - pre_upgrade
  86. # Pre-upgrade completed, nothing after this should be tagged pre_upgrade.
  87. # Separate step so we can execute in parallel and clear out anything unused
  88. # before we get into the serialized upgrade process which will then remove
  89. # remaining images if possible.
  90. - name: Cleanup unused Docker images
  91. hosts: oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config
  92. tasks:
  93. - include: ../cleanup_unused_images.yml
  94. - include: ../upgrade_control_plane.yml
  95. - include: ../upgrade_nodes.yml
  96. - include: ../post_control_plane.yml
  97. - include: storage_upgrade.yml