diff options
author | Jan Chaloupka <jchaloup@redhat.com> | 2017-06-30 15:38:17 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-30 15:38:17 +0200 |
commit | 820206a73ee0a4b2e7084331e6166afe5dff5962 (patch) | |
tree | cf5ba29df7cb6a0eaa746ab4e8d0aa4e004f59bf | |
parent | 09aaee45ac40f9e299aa3f784b01a2323e6c9edf (diff) | |
parent | ce10e598407d94e2b396b2aa9da5b5c33a0f4ee8 (diff) | |
download | openshift-820206a73ee0a4b2e7084331e6166afe5dff5962.tar.gz openshift-820206a73ee0a4b2e7084331e6166afe5dff5962.tar.bz2 openshift-820206a73ee0a4b2e7084331e6166afe5dff5962.tar.xz openshift-820206a73ee0a4b2e7084331e6166afe5dff5962.zip |
Merge pull request #4654 from ingvagabund/evalute-etcd-backup-directory-name-only-once
evalute etcd backup directory name only once
-rw-r--r-- | roles/etcd_common/tasks/backup.yml | 10 |
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 |