Skip to content

Commit

Permalink
修改备份恢复脚本
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghe-fit2cloud committed Aug 7, 2020
1 parent 09d3940 commit e95593d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion roles/backup/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
- name: 拉取备份至本地
fetch:
src: /etc/kubernetes/backup/etcd/etcd-snapshot.tar.gz
dest: "{{ (playbook_dir + '/' + cluster_name + '/cluster-backup/' + 'etcd-snapshot.tar.gz') }}"
dest: "{{ ('/backup/' + cluster_name + '/etcd-snapshot.tar.gz') }}"
flat: yes

- name: 移除 etcd 临时备份文件
Expand Down
4 changes: 2 additions & 2 deletions roles/restore/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- block:
- name: 读取所有备份
find:
paths: "{{ (playbook_dir + '/' + cluster_name + '/cluster-backup') | realpath }}"
paths: "{{ ('/backup/' + cluster_name) | realpath }}"
patterns: "etcd-snapshot.tar.gz"
register: etcd_back_paths

Expand Down Expand Up @@ -30,7 +30,7 @@

- name: 分发 etcd 数据库备份至所有 etcd 节点
copy:
src: "{{ playbook_dir }}/{{ cluster_name }}/cluster-backup/etcd-snapshot.tar.gz"
src: "/backup/{{ cluster_name }}/etcd-snapshot.tar.gz"
dest: /etc/kubernetes/backup/etcd/etcd-snapshot.tar.gz

- name: 解压 etcd 数据库备份
Expand Down

0 comments on commit e95593d

Please sign in to comment.