From c1905bfa23638a6561aeebfb5e44e3e23e1b41f8 Mon Sep 17 00:00:00 2001 From: Ivan Font Date: Thu, 11 Aug 2016 18:24:26 -0700 Subject: [PATCH 1/2] Update for containerized purge cluster playbook - Added support for purging containerized rbd-mirror node Signed-off-by: Ivan Font --- .../purge-docker-cluster.yml | 67 ++++++++++++++++--- 1 file changed, 57 insertions(+), 10 deletions(-) diff --git a/infrastructure-playbooks/purge-docker-cluster.yml b/infrastructure-playbooks/purge-docker-cluster.yml index 3f33cbdac..ba96fdb0d 100644 --- a/infrastructure-playbooks/purge-docker-cluster.yml +++ b/infrastructure-playbooks/purge-docker-cluster.yml @@ -130,6 +130,49 @@ remove_img +- name: purge ceph rbd-mirror cluster + + vars: + rbdmirror_group_name: rbd_mirrors + + hosts: + - "{{ rbdmirror_group_name }}" + + become: true + + tasks: + - include_vars: roles/ceph-common/defaults/main.yml + - include_vars: roles/ceph-rbd-mirror/defaults/main.yml + - include_vars: group_vars/all + + - name: disable ceph rbd-mirror service + service: + name: "ceph-rbd-mirror@{{ ansible_hostname }}" + state: stopped + enabled: no + ignore_errors: true + + - name: remove ceph rbd-mirror container + docker: + image: "{{ ceph_rbd_mirror_docker_username }}/{{ ceph_rbd_mirror_docker_imagename }}:{{ ceph_rbd_mirror_docker_image_tag }}" + name: "{{ ansible_hostname }}" + state: absent + ignore_errors: true + + - name: remove ceph rbd-mirror service + file: + path: /etc/systemd/system/ceph-rbd-mirror@.service + state: absent + + - name: remove ceph rbd-mirror image + docker_image: + state: absent + name: "{{ ceph_rbd_mirror_docker_username }}/{{ ceph_rbd_mirror_docker_imagename }}" + tag: "{{ ceph_rbd_mirror_docker_image_tag }}" + tags: + remove_img + + - name: purge ceph nfs cluster vars: @@ -327,17 +370,19 @@ - name: remove installed packages vars: - mon_group_name: mons - osd_group_name: osds - mds_group_name: mdss - rgw_group_name: rgws - nfs_group_name: nfss + mon_group_name: mons + osd_group_name: osds + mds_group_name: mdss + rgw_group_name: rgws + rbdmirror_group_name: rbd_mirrors + nfs_group_name: nfss hosts: - "{{ mon_group_name }}" - "{{ osd_group_name }}" - "{{ mds_group_name }}" - "{{ rgw_group_name }}" + - "{{ rbdmirror_group_name }}" - "{{ nfs_group_name }}" become: true @@ -495,17 +540,19 @@ - name: purge ceph directories vars: - mon_group_name: mons - osd_group_name: osds - mds_group_name: mdss - rgw_group_name: rgws - nfs_group_name: nfss + mon_group_name: mons + osd_group_name: osds + mds_group_name: mdss + rgw_group_name: rgws + rbdmirror_group_name: rbd_mirrors + nfs_group_name: nfss hosts: - "{{ mon_group_name }}" - "{{ osd_group_name }}" - "{{ mds_group_name }}" - "{{ rgw_group_name }}" + - "{{ rbdmirror_group_name }}" - "{{ nfs_group_name }}" gather_facts: false # Already gathered previously From 7c9cb0993ead5cca38f0a319e4884fc2daa47da3 Mon Sep 17 00:00:00 2001 From: Ivan Font Date: Fri, 12 Aug 2016 09:47:10 -0700 Subject: [PATCH 2/2] Include group_vars files in purge cluster playbook - Add all relevant group_vars files in containerized purge cluster playbook and ignore errors if file may not exist. - Also fixing indentation issues. Signed-off-by: Ivan Font --- .../purge-docker-cluster.yml | 56 +++++++++++++++---- 1 file changed, 46 insertions(+), 10 deletions(-) diff --git a/infrastructure-playbooks/purge-docker-cluster.yml b/infrastructure-playbooks/purge-docker-cluster.yml index ba96fdb0d..dce304bf9 100644 --- a/infrastructure-playbooks/purge-docker-cluster.yml +++ b/infrastructure-playbooks/purge-docker-cluster.yml @@ -58,6 +58,9 @@ - include_vars: roles/ceph-common/defaults/main.yml - include_vars: roles/ceph-mds/defaults/main.yml - include_vars: group_vars/all + ignore_errors: true + - include_vars: group_vars/mdss + ignore_errors: true - name: disable ceph mds service service: @@ -75,8 +78,8 @@ - name: remove ceph mds service file: - path: /etc/systemd/system/ceph-mds@.service - state: absent + path: /etc/systemd/system/ceph-mds@.service + state: absent - name: remove ceph mds image docker_image: @@ -101,6 +104,9 @@ - include_vars: roles/ceph-common/defaults/main.yml - include_vars: roles/ceph-rgw/defaults/main.yml - include_vars: group_vars/all + ignore_errors: true + - include_vars: group_vars/rgws + ignore_errors: true - name: disable ceph rgw service service: @@ -118,8 +124,8 @@ - name: remove ceph rgw service file: - path: /etc/systemd/system/ceph-rgw@.service - state: absent + path: /etc/systemd/system/ceph-rgw@.service + state: absent - name: remove ceph rgw image docker_image: @@ -144,6 +150,9 @@ - include_vars: roles/ceph-common/defaults/main.yml - include_vars: roles/ceph-rbd-mirror/defaults/main.yml - include_vars: group_vars/all + ignore_errors: true + - include_vars: group_vars/rbd-mirrors + ignore_errors: true - name: disable ceph rbd-mirror service service: @@ -161,8 +170,8 @@ - name: remove ceph rbd-mirror service file: - path: /etc/systemd/system/ceph-rbd-mirror@.service - state: absent + path: /etc/systemd/system/ceph-rbd-mirror@.service + state: absent - name: remove ceph rbd-mirror image docker_image: @@ -187,6 +196,9 @@ - include_vars: roles/ceph-common/defaults/main.yml - include_vars: roles/ceph-nfs/defaults/main.yml - include_vars: group_vars/all + ignore_errors: true + - include_vars: group_vars/nfss + ignore_errors: true - name: disable ceph nfs service service: @@ -239,6 +251,9 @@ - include_vars: roles/ceph-common/defaults/main.yml - include_vars: roles/ceph-osd/defaults/main.yml - include_vars: group_vars/all + ignore_errors: true + - include_vars: group_vars/osds + ignore_errors: true - name: disable ceph osd service service: @@ -305,8 +320,8 @@ - name: remove ceph osd service file: - path: /etc/systemd/system/ceph-osd@.service - state: absent + path: /etc/systemd/system/ceph-osd@.service + state: absent - name: remove ceph osd image docker_image: @@ -332,6 +347,11 @@ - include_vars: roles/ceph-mon/defaults/main.yml - include_vars: roles/ceph-restapi/defaults/main.yml - include_vars: group_vars/all + ignore_errors: true + - include_vars: group_vars/mons + ignore_errors: true + - include_vars: group_vars/restapis + ignore_errors: true - name: disable ceph mon service service: @@ -352,11 +372,12 @@ image: "{{ ceph_restapi_docker_username }}/{{ ceph_restapi_docker_imagename }}:{{ ceph_restapi_docker_image_tag }}" name: "{{ ansible_hostname }}-ceph-restapi" state: absent + ignore_errors: true - name: remove ceph mon service file: - path: /etc/systemd/system/ceph-mon@.service - state: absent + path: /etc/systemd/system/ceph-mon@.service + state: absent - name: remove ceph mon image docker_image: @@ -580,6 +601,21 @@ tasks: - include_vars: roles/ceph-common/defaults/main.yml - include_vars: group_vars/all + ignore_errors: true + - include_vars: group_vars/mdss + ignore_errors: true + - include_vars: group_vars/rgws + ignore_errors: true + - include_vars: group_vars/rbd-mirrors + ignore_errors: true + - include_vars: group_vars/nfss + ignore_errors: true + - include_vars: group_vars/osds + ignore_errors: true + - include_vars: group_vars/mons + ignore_errors: true + - include_vars: group_vars/restapis + ignore_errors: true - name: purge fetch directory for localhost file: