优化etcd备份文件名称

pull/918/head
烂泥行天下 2020-09-09 10:03:14 +08:00 committed by jmgao
parent d2ba5806d5
commit 669be72a14
1 changed files with 4 additions and 1 deletions

View File

@ -28,10 +28,13 @@
- debug: var="RUNNING_NODE.stdout"
- name: get current time
set_fact: temp="{{lookup('pipe','date \"+%Y%m%d_%H%M\"')}}"
# step2: backup data on the healthy member
- name: make a backup on etcd node
shell: "mkdir -p /etcd_backup && cd /etcd_backup && \
ETCDCTL_API=3 {{ bin_dir }}/etcdctl snapshot save snapshot.db"
ETCDCTL_API=3 {{ bin_dir }}/etcdctl snapshot save snapshot_{{ temp }}.db"
args:
warn: false
delegate_to: "{{ RUNNING_NODE.stdout }}"