invoking the playbook"
when: ireallymeanit != 'yes'
-- name: gather facts and check init system
+- name: gather facts on all hosts
vars:
mon_group_name: mons
become: true
tasks:
- - name: detect init system
- command: ceph-detect-init
- register: init_system
+ - debug: msg="gather facts on all Ceph hosts for following reference"
- name: purge ceph mds cluster
name: ceph-mds@{{ ansible_hostname }}
state: stopped
enabled: no
- when: init_system.stdout == 'systemd'
+ when: ansible_service_mgr == 'systemd'
- name: stop ceph mdss
shell: "service ceph status mds ; if [ $? == 0 ] ; then service ceph stop mds ; else echo ; fi"
- when: init_system.stdout == 'sysvinit'
+ when: ansible_service_mgr == 'sysvinit'
- name: stop ceph mdss on ubuntu
command: initctl stop ceph-mds cluster={{ cluster }} id={{ ansible_hostname }}
failed_when: false
- when: init_system.stdout == 'upstart'
+ when: ansible_service_mgr == 'upstart'
- name: purge ceph rgw cluster
name: ceph-radosgw@rgw.{{ ansible_hostname }}
state: stopped
enabled: no
- when: init_system.stdout == 'systemd'
+ when: ansible_service_mgr == 'systemd'
- name: stop ceph rgws
shell: "service ceph-radosgw status ; if [ $? == 0 ] ; then service ceph-radosgw stop ; else echo ; fi"
- when: init_system.stdout == 'sysvinit'
+ when: ansible_service_mgr == 'sysvinit'
- name: stop ceph rgws on ubuntu
command: initctl stop radosgw cluster={{ cluster }} id={{ ansible_hostname }}
failed_when: false
- when: init_system.stdout == 'upstart'
+ when: ansible_service_mgr == 'upstart'
- name: purge ceph rbd-mirror cluster
service:
name: ceph-rbd-mirror@admin.service
state: stopped
- when: init_system.stdout == 'systemd'
+ when: ansible_service_mgr == 'systemd'
- name: stop ceph rbd mirror on ubuntu
command: initctl stop ceph-rbd-mirror cluster={{ cluster }} id=admin
failed_when: false
- when: init_system.stdout == 'upstart'
+ when: ansible_service_mgr == 'upstart'
- name: purge ceph nfs cluster
service:
name: nfs-ganesha
state: stopped
- when: init_system.stdout == 'systemd'
+ when: ansible_service_mgr == 'systemd'
- name: stop ceph nfss
shell: "service nfs-ganesha status ; if [ $? == 0 ] ; then service nfs-ganesha stop ; else echo ; fi"
- when: init_system.stdout == 'sysvinit'
+ when: ansible_service_mgr == 'sysvinit'
- name: stop ceph nfss on ubuntu
command: initctl stop nfs-ganesha
failed_when: false
- when: init_system.stdout == 'upstart'
+ when: ansible_service_mgr == 'upstart'
- name: purge ceph osd cluster
state: stopped
enabled: no
with_items: "{{ osd_ids.stdout_lines }}"
- when: init_system.stdout == 'systemd'
+ when: ansible_service_mgr == 'systemd'
# before infernalis release, using sysvinit scripts
# we use this test so we do not have to know which RPM contains the boot script
- name: stop ceph osds
shell: "service ceph status osd ; if [ $? == 0 ] ; then service ceph stop osd ; else echo ; fi"
- when: init_system.stdout == 'sysvinit'
+ when: ansible_service_mgr == 'sysvinit'
- name: stop ceph osds on ubuntu
shell: |
initctl stop ceph-osd cluster={{ cluster }} id=$id
done
failed_when: false
- when: init_system.stdout == 'upstart'
+ when: ansible_service_mgr == 'upstart'
with_items: "{{ osd_ids.stdout_lines }}"
- name: see if ceph-disk-created data partitions are present
name: ceph-mon@{{ ansible_hostname }}
state: stopped
enabled: no
- when: init_system.stdout == 'systemd'
+ when: ansible_service_mgr == 'systemd'
- name: stop ceph mons
shell: "service ceph status mon ; if [ $? == 0 ] ; then service ceph stop mon ; else echo ; fi"
- when: init_system.stdout == 'sysvinit'
+ when: ansible_service_mgr == 'sysvinit'
- name: stop ceph mons on ubuntu
command: initctl stop ceph-mon cluster={{ cluster }} id={{ ansible_hostname }}
failed_when: false
- when: init_system.stdout == 'upstart'
+ when: ansible_service_mgr == 'upstart'
- name: remove monitor store and bootstrap keys
file:
- name: remove from sysv
shell: "update-rc.d -f ceph remove"
- when: init_system.stdout == 'sysvinit'
+ when: ansible_service_mgr == 'sysvinit'
- name: remove upstart and sysv files
shell: "find /etc -name '*ceph*' -delete"
- when: init_system.stdout == 'upstart'
+ when: ansible_service_mgr == 'upstart'
- name: remove upstart and apt logs and cache
shell: "find /var -name '*ceph*' -delete"