Code Review
/
ealt-edge.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Added centOS uninstalltion command
[ealt-edge.git]
/
ocd
/
infra
/
playbooks
/
roles
/
docker
/
tasks
/
uninstall.yml
diff --git
a/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml
b/ocd/infra/playbooks/roles/docker/tasks/uninstall.yml
index
5a01922
..
f756489
100644
(file)
--- a/
ocd/infra/playbooks/roles/docker/tasks/uninstall.yml
+++ b/
ocd/infra/playbooks/roles/docker/tasks/uninstall.yml
@@
-14,38
+14,54
@@
---
- name: Check whether docker is installed before deleting
---
- name: Check whether docker is installed before deleting
- command:
docker version
+ command:
which docker
register: result
register: result
- failed_when: false
+ ignore_errors: yes
no_log: True
- debug:
no_log: True
- debug:
- msg:
Docker is not present
- when: result.
rc == 2
+ msg:
Uninstalling docker...
+ when: result.
stdout != ""
-- meta: end_play
- when: result.rc == 2
+- debug:
+# yamllint disable rule:line-length
+ msg: Ignore Uninstall Log , Docker not installed
+# yamllint disable rule:line-length
+ when: result.stdout == ""
-- name: "Uninstall docker engine"
+- name: "U
NINSTALL: U
ninstall docker engine"
command: apt-get purge -y docker-engine
ignore_errors: yes
command: apt-get purge -y docker-engine
ignore_errors: yes
+ when: result is succeeded and ansible_architecture == 'aarch64'
-- name: "Uninstall docker"
+- name: "U
NINSTALL: U
ninstall docker"
command: apt-get purge -y docker
ignore_errors: yes
command: apt-get purge -y docker
ignore_errors: yes
+ when: result is succeeded and ansible_architecture == 'aarch64'
#when: result is succeeded and ansible_architecture == 'x86_64'
#when: result is succeeded and ansible_architecture == 'x86_64'
-- name: "Uninstall docker.io"
+- name: "U
NINSTALL: U
ninstall docker.io"
command: apt-get purge -y docker.io
ignore_errors: yes
command: apt-get purge -y docker.io
ignore_errors: yes
-
#
when: result is succeeded and ansible_architecture == 'aarch64'
+ when: result is succeeded and ansible_architecture == 'aarch64'
-- name: "Uninstall docker-ce"
+- name: "U
NINSTALL: U
ninstall docker-ce"
command: apt-get purge -y docker-ce
ignore_errors: yes
command: apt-get purge -y docker-ce
ignore_errors: yes
+ when: result is succeeded and ansible_architecture == 'aarch64'
#when: result is succeeded and ansible_architecture == 'aarch64'
#when: result is succeeded and ansible_architecture == 'aarch64'
-- name: "Uninstall docker"
+- name: "U
NINSTALL: U
ninstall docker"
command: apt-get purge -y docker-ce-cli
ignore_errors: yes
command: apt-get purge -y docker-ce-cli
ignore_errors: yes
+ when: result is succeeded and ansible_architecture == 'aarch64'
#when: result is succeeded
#when: result is succeeded
+
+- debug:
+ msg: "CentOS commands start"
+
+- name: "UNINSTALL:Uninstalled docker "
+ shell:
+ cmd: yes | yum remove docker-ce docker-ce-cli containerd.io
+ ignore_errors: yes
+ no_log: true