From c4eabdeb0ced4af7b84a662f0bd89aab9de245c0 Mon Sep 17 00:00:00 2001 From: gjmzj Date: Sun, 16 Jun 2019 22:20:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=AE=B9=E5=99=A8=E5=8C=96=E8=BF=90?= =?UTF-8?q?=E8=A1=8Ckubeasz=E6=97=B6=E6=B8=85=E7=90=86=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 99.clean.yml | 54 +++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/99.clean.yml b/99.clean.yml index 939b56b..f4b3567 100644 --- a/99.clean.yml +++ b/99.clean.yml @@ -58,34 +58,32 @@ shell: 'docker ps|grep kubeasz || echo "NOT FOUND"' register: install_info - - name: fail info - fail: msg="you CAN NOT delete dockerd, because container 'kubeasz' is running!" - when: "'kubeasz' in install_info.stdout" - - - name: stop and disable docker service - service: - name: docker - state: stopped - enabled: no - ignore_errors: true - - # as k8s-network-plugins use host-network, '/var/run/docker/netns/default' must be umounted - - name: unmount docker filesystem-1 - mount: path=/var/run/docker/netns/default state=unmounted - - - name: unmount docker filesystem-2 - mount: path=/var/lib/docker/overlay state=unmounted - - - name: remove files and dirs - file: name={{ item }} state=absent - with_items: - - "/var/lib/docker/" - - "/var/run/docker/" - - "/etc/systemd/system/docker.service" - - "/etc/systemd/system/docker.service.requires/" - - "/etc/systemd/system/docker.service.d/" - - "/etc/bash_completion.d/docker" - - "/usr/bin/docker" + - block: + - name: stop and disable docker service + service: + name: docker + state: stopped + enabled: no + ignore_errors: true + + # as k8s-network-plugins use host-network, '/var/run/docker/netns/default' must be umounted + - name: unmount docker filesystem-1 + mount: path=/var/run/docker/netns/default state=unmounted + + - name: unmount docker filesystem-2 + mount: path=/var/lib/docker/overlay state=unmounted + + - name: remove files and dirs + file: name={{ item }} state=absent + with_items: + - "/var/lib/docker/" + - "/var/run/docker/" + - "/etc/systemd/system/docker.service" + - "/etc/systemd/system/docker.service.requires/" + - "/etc/systemd/system/docker.service.d/" + - "/etc/bash_completion.d/docker" + - "/usr/bin/docker" + when: "'kubeasz' not in install_info.stdout" when: CONTAINER_RUNTIME == 'docker' - block: