]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Improve Handler support 222/head
authorSébastien Han <sebastien.han@enovance.com>
Mon, 2 Mar 2015 16:13:30 +0000 (17:13 +0100)
committerSébastien Han <sebastien.han@enovance.com>
Mon, 2 Mar 2015 16:13:30 +0000 (17:13 +0100)
Now proper commands/actions are used per hosts and groups.

Signed-off-by: Sébastien Han <sebastien.han@enovance.com>
roles/ceph-common/handlers/main.yml
roles/ceph-common/tasks/main.yml

index ac61a1b9f40e4e03e83e48743a9f355bb12b4f01..d6bf1cfc500e45fd51def6a83537d8667a6878ea 100644 (file)
@@ -2,10 +2,22 @@
 - name: update apt cache
   apt: update-cache=yes
 
-- name: restart ceph
-  command: service ceph restart
-  when: socket.rc == 0
+- name: restart ceph mons
+  command: service ceph restart mon
+  when: socket.rc == 0 and 'mons' in group_names
 
-- name: restart ceph-osd-all on ubuntu
-  shell: service ceph restart ; service ceph-osd-all restart
-  when: socket.rc == 0 and ansible_distribution == 'Ubuntu'
+- name: restart ceph osds
+  command: service ceph restart osd
+  when: socket.rc == 0 and 'osds' in group_names
+
+- name: restart ceph osds on ubuntu
+  command: restart ceph-osd-all
+  when: socket.rc == 0 and ansible_distribution == 'Ubuntu' and 'osds' in group_names
+
+- name: restart ceph mdss
+  command: service ceph restart mds
+  when: socket.rc == 0 and 'mdss' in group_names
+
+- name: restart ceph rgws
+  command: /etc/init.d/radosgw restart
+  when: socket.rc == 0 and 'rgws' in group_names
index debd7aa4ce6130a0774616d33cb5464438f82281..96a9b5f7fe7836511d98c35b6d7bdab3d9cc35bb 100644 (file)
@@ -37,5 +37,8 @@
     group=root
     mode=0644
   notify:
-    - restart ceph
-    - restart ceph-osd-all on ubuntu
+    - restart ceph mons
+    - restart ceph osds
+    - restart ceph osds on ubuntu
+    - restart ceph mdss
+    - restart ceph rgws