From da3c31cae2870a66a0524ae06c37a3fb44e1b312 Mon Sep 17 00:00:00 2001 From: Scott Dodson Date: Fri, 7 Apr 2017 09:13:43 -0400 Subject: Create member/snap directory encase it doesn't exist Fixes TASK [Copy etcd v3 data store] ************************************************* fatal: [host.redhat.com]: FAILED! => { "changed": true, "cmd": [ "cp", "-a", "/var/lib/etcd//member/snap", "/var/lib/origin/etcd-backup-pre-upgrade-20170407055413/member/" ], "delta": "0:00:00.003152", "end": "2017-04-07 01:54:17.584685", "failed": true, "rc": 1, "start": "2017-04-07 01:54:17.581533", "warnings": [] } STDERR: cp: cannot create directory ?/var/lib/origin/etcd-backup-pre-upgrade-20170407055413/member/?: No such file or directory --- playbooks/common/openshift-cluster/upgrades/etcd/backup.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'playbooks/common/openshift-cluster') diff --git a/playbooks/common/openshift-cluster/upgrades/etcd/backup.yml b/playbooks/common/openshift-cluster/upgrades/etcd/backup.yml index 347621a14..31a6c6c66 100644 --- a/playbooks/common/openshift-cluster/upgrades/etcd/backup.yml +++ b/playbooks/common/openshift-cluster/upgrades/etcd/backup.yml @@ -85,10 +85,15 @@ path: "{{ openshift.etcd.etcd_data_dir }}/member/snap/db" register: v3_db + - name: Ensure v3 backup directory exists + file: + path: "{{ openshift.common.data_dir }}/etcd-backup-{{ backup_tag | default('') }}{{ timestamp }}/member/snap" + state: directory + - name: Copy etcd v3 data store command: > - cp -a {{ openshift.etcd.etcd_data_dir }}/member/snap - {{ openshift.common.data_dir }}/etcd-backup-{{ backup_tag | default('') }}{{ timestamp }}/member/ + cp -a {{ openshift.etcd.etcd_data_dir }}/member/snap/db + {{ openshift.common.data_dir }}/etcd-backup-{{ backup_tag | default('') }}{{ timestamp }}/member/snap/ when: v3_db.stat.exists - set_fact: -- cgit v1.2.3