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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
b02f40b3
Unverified
Commit
b02f40b3
authored
Jan 5, 2021
by
Etienne Champetier
Committed by
GitHub
Jan 5, 2021
Browse files
Options
Downloads
Patches
Plain Diff
Improve reset.yml (#7094)
Signed-off-by:
Etienne Champetier
<
champetier.etienne@gmail.com
>
parent
c0fe32c4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
roles/reset/tasks/main.yml
+35
-17
35 additions, 17 deletions
roles/reset/tasks/main.yml
with
35 additions
and
17 deletions
roles/reset/tasks/main.yml
+
35
−
17
View file @
b02f40b3
...
@@ -12,15 +12,20 @@
...
@@ -12,15 +12,20 @@
-
name
:
reset | remove services
-
name
:
reset | remove services
file
:
file
:
path
:
"
/etc/systemd/system/{{
item
}}
.service
"
path
:
"
/etc/systemd/system/{{
item
}}"
state
:
absent
state
:
absent
with_items
:
with_items
:
-
kubelet
-
kubelet.service
-
vault
-
vault.service
-
calico-node
-
calico-node.service
-
containerd.service.d/http-proxy.conf
-
crio.service.d/http-proxy.conf
-
vault.service.d/http-proxy.conf
register
:
services_removed
register
:
services_removed
tags
:
tags
:
-
services
-
services
-
containerd
-
crio
-
name
:
reset | remove docker dropins
-
name
:
reset | remove docker dropins
file
:
file
:
...
@@ -30,6 +35,7 @@
...
@@ -30,6 +35,7 @@
-
docker-dns.conf
-
docker-dns.conf
-
docker-options.conf
-
docker-options.conf
-
http-proxy.conf
-
http-proxy.conf
-
docker-orphan-cleanup.conf
register
:
docker_dropins_removed
register
:
docker_dropins_removed
tags
:
tags
:
-
docker
-
docker
...
@@ -59,8 +65,13 @@
...
@@ -59,8 +65,13 @@
tags
:
tags
:
-
docker
-
docker
-
name
:
reset | check if crictl is present
stat
:
path
:
"
{{
bin_dir
}}/crictl"
register
:
crictl
-
name
:
reset | stop all cri containers
-
name
:
reset | stop all cri containers
shell
:
"
set
-o
pipefail
&&
{{
bin_dir
}}/crictl
ps
-
a
q
|
xargs
-r
{{
bin_dir
}}/crictl
-t
60s
stop"
shell
:
"
set
-o
pipefail
&&
{{
bin_dir
}}/crictl
ps
-q
|
xargs
-r
{{
bin_dir
}}/crictl
-t
60s
stop"
args
:
args
:
executable
:
/bin/bash
executable
:
/bin/bash
register
:
remove_all_cri_containers
register
:
remove_all_cri_containers
...
@@ -70,12 +81,13 @@
...
@@ -70,12 +81,13 @@
tags
:
tags
:
-
crio
-
crio
-
containerd
-
containerd
when
:
container_manager in ["crio", "containerd"]
when
:
-
crictl.stat.exists
-
container_manager in ["crio", "containerd"]
ignore_errors
:
true
-
name
:
reset | remove all cri containers
-
name
:
reset | force remove all cri containers
shell
:
"
set
-o
pipefail
&&
{{
bin_dir
}}/crictl
ps
-aq
|
xargs
-r
{{
bin_dir
}}/crictl
-t
60s
rm"
command
:
"
{{
bin_dir
}}/crictl
rm
-a
-f"
args
:
executable
:
/bin/bash
register
:
remove_all_cri_containers
register
:
remove_all_cri_containers
retries
:
5
retries
:
5
until
:
remove_all_cri_containers.rc ==
0
until
:
remove_all_cri_containers.rc ==
0
...
@@ -83,7 +95,10 @@
...
@@ -83,7 +95,10 @@
tags
:
tags
:
-
crio
-
crio
-
containerd
-
containerd
when
:
container_manager in ["crio", "containerd"] and deploy_container_engine|default(true)
when
:
-
crictl.stat.exists
-
container_manager in ["crio", "containerd"]
-
deploy_container_engine|default(true)
-
name
:
reset | stop and disable crio service
-
name
:
reset | stop and disable crio service
service
:
service
:
...
@@ -109,18 +124,21 @@
...
@@ -109,18 +124,21 @@
until
:
remove_all_cri_containers.rc ==
0
until
:
remove_all_cri_containers.rc ==
0
delay
:
5
delay
:
5
tags
:
[
containerd
]
tags
:
[
containerd
]
when
:
container_manager == "containerd"
when
:
-
crictl.stat.exists
-
container_manager == "containerd"
ignore_errors
:
true
-
name
:
reset | remove all cri pods
-
name
:
reset | force remove all cri pods
shell
:
"
set
-o
pipefail
&&
{{
bin_dir
}}/crictl
pods
-q
|
xargs
-r
{{
bin_dir
}}/crictl
-t
60s
rmp"
command
:
"
{{
bin_dir
}}/crictl
rmp
-a
-f"
args
:
executable
:
/bin/bash
register
:
remove_all_cri_containers
register
:
remove_all_cri_containers
retries
:
5
retries
:
5
until
:
remove_all_cri_containers.rc ==
0
until
:
remove_all_cri_containers.rc ==
0
delay
:
5
delay
:
5
tags
:
[
containerd
]
tags
:
[
containerd
]
when
:
container_manager == "containerd"
when
:
-
crictl.stat.exists
-
container_manager == "containerd"
-
name
:
reset | stop etcd services
-
name
:
reset | stop etcd services
service
:
service
:
...
...
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