summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Chaloupka <jchaloup@redhat.com>2017-06-30 12:19:09 +0200
committerJan Chaloupka <jchaloup@redhat.com>2017-06-30 13:28:23 +0200
commitce10e598407d94e2b396b2aa9da5b5c33a0f4ee8 (patch)
treec3443cc36ab3715f38ea0dc610385f88006ededa
parent312c1d100259b1d3778bedd8db091d6280089aba (diff)
downloadopenshift-ce10e598407d94e2b396b2aa9da5b5c33a0f4ee8.tar.gz
openshift-ce10e598407d94e2b396b2aa9da5b5c33a0f4ee8.tar.bz2
openshift-ce10e598407d94e2b396b2aa9da5b5c33a0f4ee8.tar.xz
openshift-ce10e598407d94e2b396b2aa9da5b5c33a0f4ee8.zip
evalute etcd backup directory name only once
-rw-r--r--roles/etcd_common/tasks/backup.yml10
1 files changed, 8 insertions, 2 deletions
diff --git a/roles/etcd_common/tasks/backup.yml b/roles/etcd_common/tasks/backup.yml
index 2384eeb58..1a0b857f1 100644
--- a/roles/etcd_common/tasks/backup.yml
+++ b/roles/etcd_common/tasks/backup.yml
@@ -1,4 +1,10 @@
---
+# set the etcd backup directory name here in case the tag or sufix consists of dynamic value that changes over time
+# e.g. openshift-backup-{{ lookup('pipe', 'date +%Y%m%d%H%M%S') }} value will change every second so if the date changes
+# right after setting l_etcd_incontainer_backup_dir and before l_etcd_backup_dir facts, the backup directory name is different
+- set_fact:
+ l_backup_dir_name: "openshift-backup-{{ r_etcd_common_backup_tag }}{{ r_etcd_common_backup_sufix_name }}"
+
- set_fact:
l_etcd_data_dir: "{{ etcd_data_dir }}{{ '/etcd.etcd' if r_etcd_common_etcd_runtime == 'runc' else '' }}"
@@ -6,10 +12,10 @@
l_etcd_incontainer_data_dir: "{{ etcd_data_dir }}"
- set_fact:
- l_etcd_incontainer_backup_dir: "{{ l_etcd_incontainer_data_dir }}/openshift-backup-{{ r_etcd_common_backup_tag }}{{ r_etcd_common_backup_sufix_name }}"
+ l_etcd_incontainer_backup_dir: "{{ l_etcd_incontainer_data_dir }}/{{ l_backup_dir_name }}"
- set_fact:
- l_etcd_backup_dir: "{{ l_etcd_data_dir }}/openshift-backup-{{ r_etcd_common_backup_tag }}{{ r_etcd_common_backup_sufix_name }}"
+ l_etcd_backup_dir: "{{ l_etcd_data_dir }}/{{ l_backup_dir_name }}"
# TODO: replace shell module with command and update later checks
- name: Check available disk space for etcd backup