1 # Copyright 2020 Huawei Technologies Co., Ltd.
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
16 - name: Check whether docker is installed before deleting
23 msg: Uninstalling docker...
24 when: result.stdout != ""
27 # yamllint disable rule:line-length
28 msg: Ignore Uninstall Log , Docker not installed
29 # yamllint disable rule:line-length
30 when: result.stdout == ""
32 - name: "UNINSTALL: Uninstall docker engine"
33 command: apt-get purge -y docker-engine
35 when: result is succeeded and ansible_architecture == 'aarch64'
37 - name: "UNINSTALL: Uninstall docker"
38 command: apt-get purge -y docker
40 when: result is succeeded and ansible_architecture == 'aarch64'
41 #when: result is succeeded and ansible_architecture == 'x86_64'
43 - name: "UNINSTALL: Uninstall docker.io"
44 command: apt-get purge -y docker.io
46 when: result is succeeded and ansible_architecture == 'aarch64'
48 - name: "UNINSTALL: Uninstall docker-ce"
49 command: apt-get purge -y docker-ce
51 when: result is succeeded and ansible_architecture == 'aarch64'
52 #when: result is succeeded and ansible_architecture == 'aarch64'
54 - name: "UNINSTALL: Uninstall docker"
55 command: apt-get purge -y docker-ce-cli
57 when: result is succeeded and ansible_architecture == 'aarch64'
58 #when: result is succeeded
60 - name: "UNINSTALL: Uninstall docker engine"
61 command: apt-get purge -y docker-engine
63 when: result is succeeded and ansible_architecture == 'x86_64'
65 - name: "UNINSTALL: Uninstall docker"
66 command: apt-get purge -y docker
68 when: result is succeeded and ansible_architecture == 'x86_64'
70 - name: "UNINSTALL: Uninstall docker.io"
71 command: apt-get purge -y docker.io
73 when: result is succeeded and ansible_architecture == 'x86_64'
75 - name: "UNINSTALL: Uninstall docker.io"
76 command: apt-get purge docker-ce docker-ce-cli containerd.io
78 when: result is succeeded and ansible_architecture == 'x86_64'
81 msg: "CentOS commands start"
83 - name: "UNINSTALL:Uninstalled docker "
85 cmd: yes | yum remove docker-ce docker-ce-cli containerd.io
88 when: ansible_facts['distribution'] == "CentOS"