mirror of https://github.com/ceph/ceph-ansible.git
purge-docker-cluste: add a task to check hosts
It's useful when running on CI to see what might remain on the machines.
So we list all the containers and images. We expect the list to be
empty.
We fail if we see containers running.
Signed-off-by: Sébastien Han <seb@redhat.com>
(cherry picked from commit 2bcc00896f
)
pull/3484/head
parent
f37c21a9d0
commit
8ce8d580a4
|
@ -462,7 +462,7 @@
|
||||||
environment:
|
environment:
|
||||||
CEPH_VOLUME_DEBUG: 1
|
CEPH_VOLUME_DEBUG: 1
|
||||||
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
||||||
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
CEPH_CONTAINER_BINARY: "docker"
|
||||||
with_items: "{{ lvm_volumes }}"
|
with_items: "{{ lvm_volumes }}"
|
||||||
|
|
||||||
- name: zap and destroy osds created by ceph-volume with devices
|
- name: zap and destroy osds created by ceph-volume with devices
|
||||||
|
@ -472,7 +472,7 @@
|
||||||
environment:
|
environment:
|
||||||
CEPH_VOLUME_DEBUG: 1
|
CEPH_VOLUME_DEBUG: 1
|
||||||
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
CEPH_CONTAINER_IMAGE: "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
|
||||||
CEPH_CONTAINER_BINARY: "{{ container_binary }}"
|
CEPH_CONTAINER_BINARY: "docker"
|
||||||
with_items: "{{ devices | default([]) }}"
|
with_items: "{{ devices | default([]) }}"
|
||||||
when:
|
when:
|
||||||
- osd_scenario == "lvm"
|
- osd_scenario == "lvm"
|
||||||
|
@ -561,6 +561,42 @@
|
||||||
path: /etc/profile.d/ceph-aliases.sh
|
path: /etc/profile.d/ceph-aliases.sh
|
||||||
state: absent
|
state: absent
|
||||||
|
|
||||||
|
- name: check container hosts
|
||||||
|
|
||||||
|
hosts:
|
||||||
|
- "{{ mon_group_name|default('mons') }}"
|
||||||
|
- "{{ osd_group_name|default('osds') }}"
|
||||||
|
- "{{ mds_group_name|default('mdss') }}"
|
||||||
|
- "{{ rgw_group_name|default('rgws') }}"
|
||||||
|
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
|
||||||
|
- "{{ nfs_group_name|default('nfss') }}"
|
||||||
|
- "{{ mgr_group_name|default('mgrs') }}"
|
||||||
|
|
||||||
|
become: true
|
||||||
|
|
||||||
|
tasks:
|
||||||
|
|
||||||
|
- import_role:
|
||||||
|
name: ceph-defaults
|
||||||
|
private: false
|
||||||
|
|
||||||
|
- name: show container list on all the nodes (should be empty)
|
||||||
|
command: >
|
||||||
|
docker ps --filter='name=ceph' -a -q
|
||||||
|
register: containers_list
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: show container images on all the nodes (should be empty if tags was passed remove_img)
|
||||||
|
command: >
|
||||||
|
docker images
|
||||||
|
register: images_list
|
||||||
|
changed_when: false
|
||||||
|
|
||||||
|
- name: fail if container are still present
|
||||||
|
fail:
|
||||||
|
msg: "It looks like container are still present."
|
||||||
|
when: containers_list.stdout_lines|length > 0
|
||||||
|
|
||||||
- name: remove installed packages
|
- name: remove installed packages
|
||||||
|
|
||||||
hosts:
|
hosts:
|
||||||
|
@ -750,7 +786,6 @@
|
||||||
- name: remove data
|
- name: remove data
|
||||||
shell: rm -rf /var/lib/ceph/*
|
shell: rm -rf /var/lib/ceph/*
|
||||||
|
|
||||||
|
|
||||||
- name: purge fetch directory
|
- name: purge fetch directory
|
||||||
|
|
||||||
hosts:
|
hosts:
|
||||||
|
|
Loading…
Reference in New Issue