purge: implement mgr purge

unti now, mgr nodes are not managed by purge-cluster.yml, therefore it
breaks scenario like purge_cluster.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/1947/head
Guillaume Abrioux 2017-09-23 18:02:49 +02:00
parent 4006a3872b
commit c80ba7a307
2 changed files with 61 additions and 0 deletions

View File

@ -41,6 +41,7 @@
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
- "{{ nfs_group_name|default('nfss') }}"
- "{{ client_group_name|default('clients') }}"
- "{{ mgr_group_name|default('mgrs') }}"
become: true
@ -77,6 +78,27 @@
failed_when: false
when: ansible_service_mgr == 'upstart'
- name: purge ceph mgr cluster
vars:
mgr_group_name: mgrs
hosts:
- "{{ mgr_group_name|default('mgrs') }}"
gather_facts: false # Already gathered previously
become: true
tasks:
- name: stop ceph mgrs with systemd
service:
name: ceph-mgr@{{ ansible_hostname}}
state: stopped
enabled: no
when: ansible_service_mgr == 'systemd'
- name: purge ceph rgw cluster
vars:
@ -507,6 +529,7 @@
- ceph-fs-common
- ceph-fuse
- ceph-mds
- ceph-mgr
- ceph-release
- ceph-radosgw
- calamari-server
@ -529,6 +552,7 @@
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
- "{{ nfs_group_name|default('nfss') }}"
- "{{ client_group_name|default('clients') }}"
- "{{ mgr_group_name|default('mgrs') }}"
gather_facts: false # Already gathered previously

View File

@ -87,6 +87,41 @@
tags:
remove_img
- name: purge ceph mgr cluster
hosts:
- "{{ mgr_group_name|default('mgrs') }}"
become: true
tasks:
- name: disable ceph mgr service
service:
name: "ceph-mgr@{{ ansible_hostname }}"
state: stopped
enabled: no
ignore_errors: true
- name: remove ceph mgr container
docker:
image: "{{ ceph_docker_registry }}/{{ ceph_docker_image }}:{{ ceph_docker_image_tag }}"
name: "ceph-mgr-{{ ansible_hostname }}"
state: absent
ignore_errors: true
- name: remove ceph mgr service
file:
path: /etc/systemd/system/ceph-mgr@.service
state: absent
- name: remove ceph mgr image
docker_image:
state: absent
repository: "{{ ceph_docker_registry }}"
name: "{{ ceph_docker_image }}"
tag: "{{ ceph_docker_image_tag }}"
force: yes
tags:
remove_img
- name: purge ceph rgw cluster
@ -361,6 +396,7 @@
- "{{ rgw_group_name|default('rgws') }}"
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
- "{{ nfs_group_name|default('nfss') }}"
- "{{ mgr_group_name|default('mgrs') }}"
become: true
@ -513,6 +549,7 @@
- "{{ rgw_group_name|default('rgws') }}"
- "{{ rbdmirror_group_name|default('rbdmirrors') }}"
- "{{ nfs_group_name|default('nfss') }}"
- "{{ mgr_group_name|default('mgrs') }}"
gather_facts: false # Already gathered previously