Change backup handler to only run v2 data backup if snap directory exists (#1594)

pull/1392/head
sgmitchell 2017-08-31 11:23:24 -04:00 committed by Matthew Mosesohn
parent 93304e5f58
commit 783924e671
1 changed files with 7 additions and 0 deletions

View File

@ -5,6 +5,7 @@
- Refresh Time Fact
- Set Backup Directory
- Create Backup Directory
- Stat etcd v2 data directory
- Backup etcd v2 data
- Backup etcd v3 data
when: etcd_cluster_is_healthy.rc == 0
@ -24,7 +25,13 @@
group: root
mode: 0600
- name: Stat etcd v2 data directory
stat:
path: "{{ etcd_data_dir }}/member"
register: etcd_data_dir_member
- name: Backup etcd v2 data
when: etcd_data_dir_member.stat.exists
command: >-
{{ bin_dir }}/etcdctl backup
--data-dir {{ etcd_data_dir }}