config.yml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. ---
  2. # for control-plane upgrade, several variables may be passed in to this play
  3. # why may affect the tasks here and in imported playbooks.
  4. # Pre-upgrade
  5. - import_playbook: ../initialize_nodes_to_upgrade.yml
  6. - name: Update repos on upgrade hosts
  7. hosts: "{{ l_upgrade_repo_hosts }}"
  8. roles:
  9. - openshift_repos
  10. - name: Set openshift_no_proxy_internal_hostnames
  11. hosts: "{{ l_upgrade_no_proxy_hosts }}"
  12. tasks:
  13. - set_fact:
  14. openshift_no_proxy_internal_hostnames: "{{ hostvars | lib_utils_oo_select_keys(groups['oo_nodes_to_config']
  15. | union(groups['oo_masters_to_config'])
  16. | union(groups['oo_etcd_to_config'] | default([])))
  17. | lib_utils_oo_collect('openshift.common.hostname') | default([]) | join (',')
  18. }}"
  19. when:
  20. - openshift_http_proxy is defined or openshift_https_proxy is defined
  21. - openshift_generate_no_proxy_hosts | default(True) | bool
  22. - name: OpenShift Health Checks
  23. hosts: "{{ l_upgrade_health_check_hosts }}"
  24. any_errors_fatal: true
  25. roles:
  26. - openshift_health_checker
  27. vars:
  28. - r_openshift_health_checker_playbook_context: upgrade
  29. post_tasks:
  30. - name: Run health checks (upgrade)
  31. action: openshift_health_check
  32. args:
  33. checks:
  34. - disk_availability
  35. - memory_availability
  36. - docker_image_availability
  37. - import_playbook: ../disable_excluders.yml
  38. - import_playbook: ../../../../init/version.yml
  39. vars:
  40. # Request specific openshift_release and let the openshift_version role handle converting this
  41. # to a more specific version, respecting openshift_image_tag and openshift_pkg_version if
  42. # defined, and overriding the normal behavior of protecting the installed version
  43. openshift_release: "{{ openshift_upgrade_target }}"
  44. # openshift_protect_installed_version is passed n via upgrade_control_plane.yml
  45. # l_openshift_version_set_hosts is passed via upgrade_control_plane.yml
  46. # l_openshift_version_check_hosts is passed via upgrade_control_plane.yml
  47. # version_override will set various version-related variables during a double upgrade.
  48. - import_playbook: version_override.yml
  49. when: l_double_upgrade_cp | default(False)
  50. - import_playbook: verify_cluster.yml
  51. # If we're only upgrading nodes, we need to ensure masters are already upgraded
  52. - name: Verify masters are already upgraded
  53. hosts: oo_masters_to_config
  54. tasks:
  55. - fail: msg="Master running {{ openshift.common.version }} must be upgraded to {{ openshift_version }} before node upgrade can be run."
  56. when:
  57. - l_upgrade_nodes_only | default(False) | bool
  58. - not openshift.common.version | match(openshift_version)
  59. # If we're only upgrading nodes, skip this.
  60. - import_playbook: ../../../../openshift-master/private/validate_restart.yml
  61. when: not (l_upgrade_nodes_only | default(False)) | bool
  62. - name: Verify upgrade targets
  63. hosts: "{{ l_upgrade_verify_targets_hosts }}"
  64. roles:
  65. - role: openshift_facts
  66. tasks:
  67. - include_tasks: verify_upgrade_targets.yml
  68. - name: Verify docker upgrade targets
  69. hosts: "{{ l_upgrade_docker_target_hosts }}"
  70. tasks:
  71. - import_role:
  72. name: container_runtime
  73. tasks_from: docker_upgrade_check.yml
  74. when: docker_upgrade | default(True) | bool