Bläddra i källkod

Merge pull request #4915 from sdodson/etcd-migration-changes

Stop masters before backing up, block migration for supported configs
Scott Dodson 7 år sedan
förälder
incheckning
e7ae854e6f
2 ändrade filer med 24 tillägg och 20 borttagningar
  1. 20 20
      playbooks/common/openshift-etcd/migrate.yml
  2. 4 0
      roles/etcd_migrate/tasks/check.yml

+ 20 - 20
playbooks/common/openshift-etcd/migrate.yml

@@ -17,6 +17,26 @@
   tags:
   - always
 
+- name: Prepare masters for etcd data migration
+  hosts: oo_masters_to_config
+  tasks:
+  - set_fact:
+      master_services:
+      - "{{ openshift.common.service_type + '-master' }}"
+  - set_fact:
+      master_services:
+      - "{{ openshift.common.service_type + '-master-controllers' }}"
+      - "{{ openshift.common.service_type + '-master-api' }}"
+    when:
+    - (openshift_master_cluster_method is defined and openshift_master_cluster_method == "native") or openshift.common.is_master_system_container | bool
+  - debug:
+      msg: "master service name: {{ master_services }}"
+  - name: Stop masters
+    service:
+      name: "{{ item }}"
+      state: stopped
+    with_items: "{{ master_services }}"
+
 - name: Backup v2 data
   hosts: oo_etcd_to_migrate
   gather_facts: no
@@ -47,26 +67,6 @@
     when:
     - etcd_backup_failed | length > 0
 
-- name: Prepare masters for etcd data migration
-  hosts: oo_masters_to_config
-  tasks:
-  - set_fact:
-      master_services:
-      - "{{ openshift.common.service_type + '-master' }}"
-  - set_fact:
-      master_services:
-      - "{{ openshift.common.service_type + '-master-controllers' }}"
-      - "{{ openshift.common.service_type + '-master-api' }}"
-    when:
-    - (openshift_master_cluster_method is defined and openshift_master_cluster_method == "native") or openshift.common.is_master_system_container | bool
-  - debug:
-      msg: "master service name: {{ master_services }}"
-  - name: Stop masters
-    service:
-      name: "{{ item }}"
-      state: stopped
-    with_items: "{{ master_services }}"
-
 - name: Migrate etcd data from v2 to v3
   hosts: oo_etcd_to_migrate
   gather_facts: no

+ 4 - 0
roles/etcd_migrate/tasks/check.yml

@@ -1,4 +1,8 @@
 ---
+- fail:
+    msg: "Currently etcd v3 migration is unsupported while we test it more thoroughly"
+  when: not openshift_enable_unsupported_configurations | default(false) | bool
+
 # Check the cluster is healthy
 - include: check_cluster_health.yml