summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Chaloupka <jchaloup@redhat.com>2017-11-01 21:29:54 +0100
committerJan Chaloupka <jchaloup@redhat.com>2017-11-01 21:29:54 +0100
commit8d5e7b36d508298a0d92cba9c0f654c24c2fb0f2 (patch)
treef047bf75010a37bd9190131b0452e0ceb68da3e5
parent5bfc68706be9127199a3f3f06e04588720ed50f5 (diff)
downloadopenshift-8d5e7b36d508298a0d92cba9c0f654c24c2fb0f2.tar.gz
openshift-8d5e7b36d508298a0d92cba9c0f654c24c2fb0f2.tar.bz2
openshift-8d5e7b36d508298a0d92cba9c0f654c24c2fb0f2.tar.xz
openshift-8d5e7b36d508298a0d92cba9c0f654c24c2fb0f2.zip
check presence of v2 snapshot before the migration proceeds
-rw-r--r--roles/etcd/tasks/migration/check.yml11
1 files changed, 11 insertions, 0 deletions
diff --git a/roles/etcd/tasks/migration/check.yml b/roles/etcd/tasks/migration/check.yml
index 0804d9e1c..5c45e5ae1 100644
--- a/roles/etcd/tasks/migration/check.yml
+++ b/roles/etcd/tasks/migration/check.yml
@@ -3,6 +3,17 @@
# Check the cluster is healthy
- include: check_cluster_health.yml
+# Check if there is at least one v2 snapshot
+- name: Check if there is at least one v2 snapshot
+ find:
+ paths: "{{ etcd_data_dir }}/member/snap"
+ patterns: '*.snap'
+ register: snapshots_result
+
+- fail:
+ msg: "Before the migration can proceed the etcd member must write down at least one snapshot under {{ etcd_data_dir }}/member/snap directory."
+ when: snapshots_result.matched | int == 0
+
# Check if the member has v3 data already
# Run the migration only if the data are v2
- name: Check if there are any v3 data