purge-docker-cluster: remove docker data

We never clean the content of /var/lib/docker so we can still have
some data present in this directory after run the purge playbook.
Pip isn't used anymore.
Also update the docker package name (especially the python binding
one).

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
(cherry picked from commit 168d7cd016)
pull/3986/head
Dimitri Savineau 2019-05-13 17:03:55 -04:00 committed by Guillaume Abrioux
parent bd33bcef2b
commit 1e23d853f9
1 changed files with 7 additions and 27 deletions

View File

@ -512,33 +512,13 @@
when: not is_atomic when: not is_atomic
ignore_errors: true ignore_errors: true
- name: debian based systems tasks - name: remove docker on debian/ubuntu
block:
- name: remove docker-py on debian
pip:
name: docker-py
state: absent
- name: remove six on debian
pip:
name: six
state: absent
- name: remove pip and docker on debian
apt: apt:
name: ['python-pip', 'docker-engine'] name: ['docker-ce', 'docker-engine', 'docker.io', 'python-docker', 'python3-docker']
state: absent state: absent
update_cache: yes update_cache: yes
autoremove: yes autoremove: yes
when: ansible_distribution == 'Debian' when: ansible_os_family == 'Debian'
- name: remove pip and docker on ubuntu
apt:
name: ['python-pip', 'docker', 'docker.io']
state: absent
update_cache: yes
autoremove: yes
when: ansible_distribution == 'Ubuntu'
- name: red hat based systems tasks - name: red hat based systems tasks
block: block:
@ -546,7 +526,7 @@
block: block:
- name: remove packages on redhat - name: remove packages on redhat
yum: yum:
name: ['epel-release', 'python-pip', 'docker-engine', 'docker'] name: ['epel-release', 'docker', 'python-docker-py']
state: absent state: absent
- name: remove package dependencies on redhat - name: remove package dependencies on redhat
@ -563,9 +543,9 @@
- name: dnf related tasks on red hat - name: dnf related tasks on red hat
block: block:
- name: remove pip and docker on redhat - name: remove docker on redhat
dnf: dnf:
name: ['python-pip', 'docker-engine', 'docker'] name: ['docker', 'python3-docker']
state: absent state: absent
- name: remove package dependencies on redhat - name: remove package dependencies on redhat
@ -608,7 +588,7 @@
- /var/log/ceph - /var/log/ceph
- name: remove data - name: remove data
shell: rm -rf /var/lib/ceph/* shell: rm -rf /var/lib/ceph/* /var/lib/docker/*
- name: purge fetch directory - name: purge fetch directory