|
@@ -1,6 +1,14 @@
|
|
|
---
|
|
|
-- import_tasks: upgrade/rpm_upgrade.yml
|
|
|
- when: not openshift_is_containerized | bool
|
|
|
+- name: Stop control plane services
|
|
|
+ service:
|
|
|
+ name: "{{ item }}"
|
|
|
+ state: stopped
|
|
|
+ with_items:
|
|
|
+ - "{{ openshift_service_type }}-master-api"
|
|
|
+ - "{{ openshift_service_type }}-master-controllers"
|
|
|
+ failed_when: false
|
|
|
+
|
|
|
+- import_tasks: static_shim.yml
|
|
|
|
|
|
- import_tasks: upgrade/upgrade_scheduler.yml
|
|
|
|
|
@@ -8,8 +16,6 @@
|
|
|
- include_tasks: "upgrade/{{ master_config_hook }}"
|
|
|
when: master_config_hook is defined
|
|
|
|
|
|
-- import_tasks: systemd_units.yml
|
|
|
-
|
|
|
- import_tasks: set_loopback_context.yml
|
|
|
|
|
|
- name: Check for ca-bundle.crt
|
|
@@ -37,6 +43,37 @@
|
|
|
state: link
|
|
|
when: ca_crt_stat.stat.isreg and not ca_bundle_stat.stat.exists
|
|
|
|
|
|
+- name: Find existing master sysconfig
|
|
|
+ find:
|
|
|
+ paths:
|
|
|
+ - /etc/sysconfig
|
|
|
+ patterns:
|
|
|
+ - openshift-master-api
|
|
|
+ - openshift-master-controllers
|
|
|
+ - origin-master-api
|
|
|
+ - origin-master-controllers
|
|
|
+ register: sysconfigs
|
|
|
+- when: sysconfigs|succeeded and sysconfigs.matched > 0
|
|
|
+ name: Migrate OPENSHIFT_DEFAULT_REGISTRY from master sysconfig to master-config.yaml
|
|
|
+ block:
|
|
|
+ - name: Get master sysconfig contents
|
|
|
+ slurp:
|
|
|
+ src: "{{ sysconfigs.files[0].path }}"
|
|
|
+ register: sysconfig
|
|
|
+ # TODO: surely there is a better way
|
|
|
+ - name: Update imagePolicyConfig.internalRegistryHostname
|
|
|
+ yedit:
|
|
|
+ src: "{{ openshift.common.config_base }}/master/master-config.yaml"
|
|
|
+ key: "imagePolicyConfig.internalRegistryHostname"
|
|
|
+ value: "{{ item | regex_replace('^OPENSHIFT_DEFAULT_REGISTRY=\\s*([^#\\s]+).*','\\1') }}"
|
|
|
+ with_items: "{{ (sysconfig.content | b64decode).split('\n') | select('match','^OPENSHIFT_DEFAULT_REGISTRY=\\s*.+') | list }}"
|
|
|
+
|
|
|
+- name: Create the master service env file if it does not exist
|
|
|
+ template:
|
|
|
+ src: "master.env.j2"
|
|
|
+ dest: "{{ openshift.common.config_base }}/master/master.env"
|
|
|
+ force: no
|
|
|
+
|
|
|
- name: Update oreg value
|
|
|
yedit:
|
|
|
src: "{{ openshift.common.config_base }}/master/master-config.yaml"
|
|
@@ -50,3 +87,38 @@
|
|
|
key: 'projectConfig.defaultNodeSelector'
|
|
|
value: '{{ hostvars[groups.oo_first_master.0].l_osm_default_node_selector }}'
|
|
|
when: openshift_upgrade_target | version_compare('3.9', '>=')
|
|
|
+
|
|
|
+- name: Remove use of pod presets from master config
|
|
|
+ yedit:
|
|
|
+ src: "{{ openshift.common.config_base }}/master/master-config.yaml"
|
|
|
+ key: 'admissionConfig.pluginConfig.PodPreset'
|
|
|
+ state: absent
|
|
|
+- name: Find current value for runtime-config
|
|
|
+ yedit:
|
|
|
+ src: "/tmp/master-config.yaml"
|
|
|
+ key: "kubernetesMasterConfig.apiServerArguments.runtime-config"
|
|
|
+ state: list
|
|
|
+ register: runtime_config
|
|
|
+- name: Set the runtime-config to exclude pod presets
|
|
|
+ yedit:
|
|
|
+ src: "{{ openshift.common.config_base }}/master/master-config.yaml"
|
|
|
+ key: "kubernetesMasterConfig.apiServerArguments.runtime-config"
|
|
|
+ value: "{{ runtime_config.result | join(',') | regex_replace('(?:,)*apis/settings\\.k8s\\.io/v1alpha1=true','') }}"
|
|
|
+ when: runtime_config.result
|
|
|
+
|
|
|
+- name: Remove old service information
|
|
|
+ file:
|
|
|
+ path: "{{ item }}"
|
|
|
+ state: absent
|
|
|
+ with_items:
|
|
|
+ - /etc/systemd/system/atomic-openshift-master-api.service
|
|
|
+ - /etc/systemd/system/atomic-openshift-master-controllers.service
|
|
|
+ - /etc/systemd/system/origin-master-api.service
|
|
|
+ - /etc/systemd/system/origin-master-controllers.service
|
|
|
+ - /usr/lib/systemd/system/atomic-openshift-master-api.service
|
|
|
+ - /usr/lib/systemd/system/atomic-openshift-master-controllers.service
|
|
|
+ - /usr/lib/systemd/system/origin-master-api.service
|
|
|
+ - /usr/lib/systemd/system/origin-master-controllers.service
|
|
|
+
|
|
|
+- name: reload systemd units
|
|
|
+ command: systemctl daemon-reload
|