upgrade_control_plane.yml 3.6 KB

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