Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
2b97b661
Unverified
Commit
2b97b661
authored
2 years ago
by
emiran-orange
Committed by
GitHub
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Move old etcd backup removal after etcd restart (#9147)
parent
24f12b02
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
roles/etcd/handlers/backup.yml
+0
-7
0 additions, 7 deletions
roles/etcd/handlers/backup.yml
roles/etcd/handlers/backup_cleanup.yml
+11
-0
11 additions, 0 deletions
roles/etcd/handlers/backup_cleanup.yml
roles/etcd/handlers/main.yml
+3
-0
3 additions, 0 deletions
roles/etcd/handlers/main.yml
with
14 additions
and
7 deletions
roles/etcd/handlers/backup.yml
+
0
−
7
View file @
2b97b661
...
...
@@ -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
This diff is collapsed.
Click to expand it.
roles/etcd/handlers/backup_cleanup.yml
0 → 100644
+
11
−
0
View file @
2b97b661
---
-
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
This diff is collapsed.
Click to expand it.
roles/etcd/handlers/main.yml
+
3
−
0
View file @
2b97b661
...
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment