upgrade.yml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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:
  38. - openshift_http_proxy is defined or openshift_https_proxy is defined
  39. - openshift_generate_no_proxy_hosts | default(True) | bool
  40. - include: ../pre/verify_inventory_vars.yml
  41. tags:
  42. - pre_upgrade
  43. - include: ../pre/verify_control_plane_running.yml
  44. tags:
  45. - pre_upgrade
  46. - include: ../disable_master_excluders.yml
  47. tags:
  48. - pre_upgrade
  49. - include: ../disable_node_excluders.yml
  50. tags:
  51. - pre_upgrade
  52. - include: ../../initialize_openshift_version.yml
  53. tags:
  54. - pre_upgrade
  55. vars:
  56. # Request specific openshift_release and let the openshift_version role handle converting this
  57. # to a more specific version, respecting openshift_image_tag and openshift_pkg_version if
  58. # defined, and overriding the normal behavior of protecting the installed version
  59. openshift_release: "{{ openshift_upgrade_target }}"
  60. openshift_protect_installed_version: False
  61. # We skip the docker role at this point in upgrade to prevent
  62. # unintended package, container, or config upgrades which trigger
  63. # docker restarts. At this early stage of upgrade we can assume
  64. # docker is configured and running.
  65. skip_docker_role: True
  66. - include: ../../../openshift-master/validate_restart.yml
  67. tags:
  68. - pre_upgrade
  69. - name: Verify upgrade targets
  70. hosts: oo_masters_to_config:oo_nodes_to_upgrade
  71. tasks:
  72. - include: ../pre/verify_upgrade_targets.yml
  73. tags:
  74. - pre_upgrade
  75. - name: Verify docker upgrade targets
  76. hosts: oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config
  77. tasks:
  78. - include: ../pre/tasks/verify_docker_upgrade_targets.yml
  79. tags:
  80. - pre_upgrade
  81. - include: validator.yml
  82. tags:
  83. - pre_upgrade
  84. - include: ../pre/gate_checks.yml
  85. tags:
  86. - pre_upgrade
  87. # Pre-upgrade completed, nothing after this should be tagged pre_upgrade.
  88. # Separate step so we can execute in parallel and clear out anything unused
  89. # before we get into the serialized upgrade process which will then remove
  90. # remaining images if possible.
  91. - name: Cleanup unused Docker images
  92. hosts: oo_masters_to_config:oo_nodes_to_upgrade:oo_etcd_to_config
  93. tasks:
  94. - include: ../cleanup_unused_images.yml
  95. - include: ../upgrade_control_plane.yml
  96. vars:
  97. master_config_hook: "v3_5/master_config_upgrade.yml"
  98. - include: ../upgrade_nodes.yml
  99. - include: ../post_control_plane.yml