summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2017-06-07 15:53:31 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2017-06-08 17:36:02 +0200
commit098e93cc02adb16f35574127ba86326a8e236a94 (patch)
treedf79a04b6753a4f3ea3b302a673805f268fcbbd2
parenteca2dfb1caf0ea96e4e8d280f50f60832bf0cf9f (diff)
downloadopenshift-098e93cc02adb16f35574127ba86326a8e236a94.tar.gz
openshift-098e93cc02adb16f35574127ba86326a8e236a94.tar.bz2
openshift-098e93cc02adb16f35574127ba86326a8e236a94.tar.xz
openshift-098e93cc02adb16f35574127ba86326a8e236a94.zip
etcd: copy previous database when migrating to system container
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r--roles/etcd/tasks/system_container.yml24
1 files changed, 24 insertions, 0 deletions
diff --git a/roles/etcd/tasks/system_container.yml b/roles/etcd/tasks/system_container.yml
index 72ffadbd2..34bff52b1 100644
--- a/roles/etcd/tasks/system_container.yml
+++ b/roles/etcd/tasks/system_container.yml
@@ -15,6 +15,30 @@
{%- endif -%}
{% endfor -%}
+- name: Check for previous etcd data store
+ stat:
+ path: "{{ etcd_data_dir }}/member/"
+ register: src_datastore
+
+- name: Check for etcd system container data store
+ stat:
+ path: "{{ r_etcd_common_system_container_host_dir }}/etcd.etcd/member"
+ register: dest_datastore
+
+- name: Ensure that etcd system container data dirs exist
+ file: path="{{ item }}" state=directory
+ with_items:
+ - "{{ r_etcd_common_system_container_host_dir }}/etc"
+ - "{{ r_etcd_common_system_container_host_dir }}/etcd.etcd"
+
+- name: Copy etcd data store
+ command: >
+ cp -a {{ etcd_data_dir }}/member
+ {{ r_etcd_common_system_container_host_dir }}/etcd.etcd/member
+ when:
+ - src_datastore.stat.exists
+ - not dest_datastore.stat.exists
+
- name: Install or Update Etcd system container package
oc_atomic_container:
name: etcd