emiran-orange
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
14 additions and
7 deletions
-
roles/etcd/handlers/backup.yml
-
roles/etcd/handlers/backup_cleanup.yml
-
roles/etcd/handlers/main.yml
|
|
@ -8,7 +8,6 @@ |
|
|
|
- Stat etcd v2 data directory |
|
|
|
- Backup etcd v2 data |
|
|
|
- Backup etcd v3 data |
|
|
|
- Remove old etcd backups |
|
|
|
when: etcd_cluster_is_healthy.rc == 0 |
|
|
|
|
|
|
|
- name: Refresh Time Fact |
|
|
@ -61,9 +60,3 @@ |
|
|
|
register: etcd_backup_v3_command |
|
|
|
until: etcd_backup_v3_command.rc == 0 |
|
|
|
delay: "{{ retry_stagger | random + 3 }}" |
|
|
|
|
|
|
|
- name: Remove old etcd backups |
|
|
|
shell: |
|
|
|
chdir: "{{ etcd_backup_prefix }}" |
|
|
|
cmd: "find . -name 'etcd-*' -type d | sort -n | head -n -{{ etcd_backup_retention_count }} | xargs rm -rf" |
|
|
|
when: etcd_backup_retention_count >= 0 |
|
|
@ -0,0 +1,11 @@ |
|
|
|
--- |
|
|
|
- name: Cleanup etcd backups |
|
|
|
command: /bin/true |
|
|
|
notify: |
|
|
|
- Remove old etcd backups |
|
|
|
|
|
|
|
- name: Remove old etcd backups |
|
|
|
shell: |
|
|
|
chdir: "{{ etcd_backup_prefix }}" |
|
|
|
cmd: "find . -name 'etcd-*' -type d | sort -n | head -n -{{ etcd_backup_retention_count }} | xargs rm -rf" |
|
|
|
when: etcd_backup_retention_count >= 0 |
|
|
@ -6,6 +6,7 @@ |
|
|
|
- etcd | reload systemd |
|
|
|
- reload etcd |
|
|
|
- wait for etcd up |
|
|
|
- Cleanup etcd backups |
|
|
|
|
|
|
|
- name: restart etcd-events |
|
|
|
command: /bin/true |
|
|
@ -43,6 +44,8 @@ |
|
|
|
retries: 60 |
|
|
|
delay: 1 |
|
|
|
|
|
|
|
- import_tasks: backup_cleanup.yml |
|
|
|
|
|
|
|
- name: wait for etcd-events up |
|
|
|
uri: |
|
|
|
url: "https://{% if is_etcd_master %}{{ etcd_address }}{% else %}127.0.0.1{% endif %}:2383/health" |
|
|
|