systemd_unit_files.stdout != "0" and
rgw_group_name in group_names
-# before infernalis
+ - name: stop ceph rbd mirror with systemd
+ service:
+ name: ceph-rbd-mirror@admin.service
+ state: stopped
+ when:
+ ansible_os_family == 'RedHat' and
+ systemd_unit_files.stdout != "0" and
+ rbdmirror_group_name in group_names
+
+# before infernalis release, using sysvinit scripts
+# we use this test so we do not have to know which RPM contains the boot script
+# or where it is placed.
+
- name: stop ceph osds
- command: service ceph stop osd
+ shell: "service ceph status osd ; if [ $? == 0 ] ; then service ceph stop osd ; else echo ; fi"
when:
ansible_os_family == 'RedHat' and
- osd_group_name in group_names and
- systemd_unit_files.stdout == "0"
+ osd_group_name in group_names
- name: stop ceph mons
- command: service ceph stop mon
+ shell: "service ceph status mon ; if [ $? == 0 ] ; then service ceph stop mon ; else echo ; fi"
when:
ansible_os_family == 'RedHat' and
- mon_group_name in group_names and
- systemd_unit_files.stdout == "0"
+ mon_group_name in group_names
- name: stop ceph mdss
- command: service ceph stop mds
+ shell: "service ceph status mds ; if [ $? == 0 ] ; then service ceph stop mds ; else echo ; fi"
when:
ansible_os_family == 'RedHat' and
- mds_group_name in group_names and
- systemd_unit_files.stdout == "0"
+ mds_group_name in group_names
- name: stop ceph rgws
- command: service ceph-radosgw stop
+ shell: "service ceph-radosgw status ; if [ $? == 0 ] ; then service ceph-radosgw stop ; else echo ; fi"
when:
ansible_os_family == 'RedHat' and
- rgw_group_name in group_names and
- systemd_unit_files.stdout == "0"
+ rgw_group_name in group_names
# Ubuntu 14.04
- name: stop ceph osds on ubuntu