upgrade_control_plane.yml 3.6 KB

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