upgrade_control_plane.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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: ../../../../common/openshift-cluster/upgrades/init.yml
  15. tags:
  16. - pre_upgrade
  17. # Configure the upgrade target for the common upgrade tasks:
  18. - hosts: l_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. - name: Update repos on control plane hosts
  27. hosts: oo_masters_to_config:oo_etcd_to_config:oo_lb_to_config
  28. tags:
  29. - pre_upgrade
  30. roles:
  31. - openshift_repos
  32. - name: Set openshift_no_proxy_internal_hostnames
  33. hosts: oo_masters_to_config:oo_nodes_to_upgrade
  34. tags:
  35. - pre_upgrade
  36. tasks:
  37. - set_fact:
  38. openshift_no_proxy_internal_hostnames: "{{ hostvars | oo_select_keys(groups['oo_nodes_to_config']
  39. | union(groups['oo_masters_to_config'])
  40. | union(groups['oo_etcd_to_config'] | default([])))
  41. | oo_collect('openshift.common.hostname') | default([]) | join (',')
  42. }}"
  43. when: "{{ (openshift_http_proxy is defined or openshift_https_proxy is defined) and
  44. openshift_generate_no_proxy_hosts | default(True) | bool }}"
  45. - include: ../../../../common/openshift-cluster/upgrades/pre/verify_inventory_vars.yml
  46. tags:
  47. - pre_upgrade
  48. - include: ../../../../common/openshift-cluster/disable_excluder.yml
  49. tags:
  50. - pre_upgrade
  51. - include: ../../../../common/openshift-cluster/initialize_openshift_version.yml
  52. tags:
  53. - pre_upgrade
  54. vars:
  55. # Request specific openshift_release and let the openshift_version role handle converting this
  56. # to a more specific version, respecting openshift_image_tag and openshift_pkg_version if
  57. # defined, and overriding the normal behavior of protecting the installed version
  58. openshift_release: "{{ openshift_upgrade_target }}"
  59. openshift_protect_installed_version: False
  60. # We skip the docker role at this point in upgrade to prevent
  61. # unintended package, container, or config upgrades which trigger
  62. # docker restarts. At this early stage of upgrade we can assume
  63. # docker is configured and running.
  64. skip_docker_role: True
  65. - include: ../../../../common/openshift-cluster/upgrades/pre/verify_control_plane_running.yml
  66. tags:
  67. - pre_upgrade
  68. - include: ../../../../common/openshift-master/validate_restart.yml
  69. tags:
  70. - pre_upgrade
  71. - include: ../../../../common/openshift-cluster/upgrades/pre/verify_upgrade_targets.yml
  72. tags:
  73. - pre_upgrade
  74. - include: ../../../../common/openshift-cluster/upgrades/pre/verify_docker_upgrade_targets.yml
  75. tags:
  76. - pre_upgrade
  77. - include: ../../../../common/openshift-cluster/upgrades/pre/gate_checks.yml
  78. tags:
  79. - pre_upgrade
  80. # Pre-upgrade completed, nothing after this should be tagged pre_upgrade.
  81. # Separate step so we can execute in parallel and clear out anything unused
  82. # before we get into the serialized upgrade process which will then remove
  83. # remaining images if possible.
  84. - name: Cleanup unused Docker images
  85. hosts: oo_masters_to_config:oo_etcd_to_config
  86. tasks:
  87. - include: ../../../../common/openshift-cluster/upgrades/cleanup_unused_images.yml
  88. - include: ../../../../common/openshift-cluster/upgrades/upgrade_control_plane.yml
  89. - include: ../../../../common/openshift-cluster/upgrades/post_control_plane.yml