upgrade.yml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. ---
  2. - import_tasks: registry_auth.yml
  3. - import_tasks: static_shim.yml
  4. - import_tasks: upgrade/upgrade_scheduler.yml
  5. # master_config_hook is passed in from upgrade play.
  6. - include_tasks: "upgrade/{{ master_config_hook }}"
  7. when: master_config_hook is defined
  8. - import_tasks: set_loopback_context.yml
  9. - name: Check for ca-bundle.crt
  10. stat:
  11. path: "{{ openshift.common.config_base }}/master/ca-bundle.crt"
  12. get_checksum: false
  13. get_attributes: false
  14. get_mime: false
  15. register: ca_bundle_stat
  16. failed_when: false
  17. - name: Check for ca.crt
  18. stat:
  19. path: "{{ openshift.common.config_base }}/master/ca.crt"
  20. get_checksum: false
  21. get_mime: false
  22. register: ca_crt_stat
  23. failed_when: false
  24. - name: Migrate ca.crt to ca-bundle.crt
  25. command: mv ca.crt ca-bundle.crt
  26. args:
  27. chdir: "{{ openshift.common.config_base }}/master"
  28. when: ca_crt_stat.stat.isreg and not ca_bundle_stat.stat.exists
  29. - name: Link ca.crt to ca-bundle.crt
  30. file:
  31. src: "{{ openshift.common.config_base }}/master/ca-bundle.crt"
  32. path: "{{ openshift.common.config_base }}/master/ca.crt"
  33. state: link
  34. force: yes
  35. when: ca_crt_stat.stat.isreg and not ca_bundle_stat.stat.exists
  36. # Anyone upgrading to 3.7 or 3.9 should've had their certs updated to be
  37. # compatible with this so this is the only valid value for internal registry
  38. - name: Update imagePolicyConfig.internalRegistryHostname
  39. yedit:
  40. src: "{{ openshift.common.config_base }}/master/master-config.yaml"
  41. key: "imagePolicyConfig.internalRegistryHostname"
  42. value: "docker-registry.default.svc:5000"
  43. - name: Update oreg value
  44. yedit:
  45. src: "{{ openshift.common.config_base }}/master/master-config.yaml"
  46. key: 'imageConfig.format'
  47. value: "{{ openshift_imageconfig_format }}"
  48. - name: Change default node selector to compute=true
  49. yedit:
  50. src: "{{ openshift.common.config_base }}/master/master-config.yaml"
  51. key: 'projectConfig.defaultNodeSelector'
  52. value: '{{ hostvars[groups.oo_first_master.0].l_osm_default_node_selector }}'
  53. when: openshift_upgrade_target is version('3.9', '>=')
  54. - name: Remove use of pod presets from master config
  55. yedit:
  56. src: "{{ openshift.common.config_base }}/master/master-config.yaml"
  57. key: 'admissionConfig.pluginConfig.PodPreset'
  58. state: absent
  59. - name: Find current value for runtime-config
  60. yedit:
  61. src: "/tmp/master-config.yaml"
  62. key: "kubernetesMasterConfig.apiServerArguments.runtime-config"
  63. state: list
  64. register: runtime_config
  65. - name: Set the runtime-config to exclude pod presets
  66. yedit:
  67. src: "{{ openshift.common.config_base }}/master/master-config.yaml"
  68. key: "kubernetesMasterConfig.apiServerArguments.runtime-config"
  69. value: "{{ runtime_config.result | join(',') | regex_replace('(?:,)*apis/settings\\.k8s\\.io/v1alpha1=true','') }}"
  70. when: runtime_config.result