]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Improve handlers 298/head
authorleseb <seb@redhat.com>
Tue, 30 Jun 2015 16:07:03 +0000 (18:07 +0200)
committerleseb <seb@redhat.com>
Tue, 30 Jun 2015 16:07:03 +0000 (18:07 +0200)
Signed-off-by: leseb <seb@redhat.com>
roles/ceph-common/defaults/main.yml
roles/ceph-common/handlers/main.yml
roles/ceph-common/tasks/main.yml

index 5160fe6ee55f7763a050503beebf1a683c72000c..48d2e9b95776f5e3867b0c8b184aa4699069836b 100644 (file)
@@ -80,7 +80,7 @@ rbd_concurrent_management_ops: 20
 rbd_client_directories: false # this will create rbd_client_log_path and rbd_client_admin_socket_path directories with proper permissions, this WON'T work if libvirt and kvm are installed\r
 rbd_client_log_file: /var/log/rbd-clients/qemu-guest-$pid.log # must be writable by QEMU and allowed by SELinux or AppArmor\r
 rbd_client_log_path: /var/log/rbd-clients/\r
-rbd_client_admin_socket_path: /var/run/ceph/rbd-clients/ # must be writable by QEMU and allowed by SELinux or AppArmor\r
+rbd_client_admin_socket_path: /var/run/ceph/rbd-clients # must be writable by QEMU and allowed by SELinux or AppArmor\r
 \r
 ## Monitor options\r
 #\r
index 2208466637048f2c4641ba2e8c41fc0ae1065455..0fd2f023ad16844f07114c00d8b0258837cdce42 100644 (file)
@@ -6,12 +6,21 @@
   command: service ceph restart mon
   when:
     socket.rc == 0 and
+    ansible_distribution != 'Ubuntu' and
+    mon_group_name in group_names
+
+- name: restart ceph mons on ubuntu
+  command: restart ceph-mon-all
+  when:
+    socket.rc == 0 and
+    ansible_distribution == 'Ubuntu' and
     mon_group_name in group_names
 
 - name: restart ceph osds
   command: service ceph restart osd
   when:
     socket.rc == 0 and
+    ansible_distribution != 'Ubuntu' and
     osd_group_name in group_names
 
 - name: restart ceph osds on ubuntu
     ansible_distribution == 'Ubuntu' and
     osd_group_name in group_names
 
+- name: restart ceph mdss on ubuntu
+  command: restart ceph-mds-all
+  when:
+    socket.rc == 0 and
+    ansible_distribution == 'Ubuntu' and
+    mds_group_name in group_names
+
 - name: restart ceph mdss
   command: service ceph restart mds
   when:
     socket.rc == 0 and
+    ansible_distribution != 'Ubuntu' and
     mds_group_name in group_names
 
+- name: restart ceph rgws on ubuntu
+  command: restart ceph-all
+  when:
+    socketrgw.rc == 0 and
+    ansible_distribution == 'Ubuntu' and
+    rgw_group_name in group_names
+
 - name: restart ceph rgws
   command: /etc/init.d/radosgw restart
   when:
-    socket.rc == 0 and
+    socketrgw.rc == 0 and
+    ansible_distribution != 'Ubuntu' and
+    rgw_group_name in group_names
+
+- name: restart ceph rgws on red hat
+  command: /etc/init.d/ceph-radosgw restart
+  when:
+    socketrgw.rc == 0 and
+    ansible_os_family == 'RedHat' and
     rgw_group_name in group_names
index bfac9d0b6ff52c5182ac6cb66d685529b1cd6607..e1eb44bfb73220981e02757b226c0d77e5d6e268 100644 (file)
   ignore_errors: true
   register: socket
 
+- name: check for a rados gateway socket
+  shell: "stat {{ rbd_client_admin_socket_path }}*.asok > /dev/null 2>&1"
+  changed_when: false
+  ignore_errors: true
+  register: socketrgw
+
 - name: generate cluster UUID
   shell: >
     uuidgen | tee fetch/ceph_cluster_uuid.conf
     mode=0644
   notify:
     - restart ceph mons
+    - restart ceph mons on ubuntu
     - restart ceph osds
     - restart ceph osds on ubuntu
     - restart ceph mdss
+    - restart ceph mdss on ubuntu
     - restart ceph rgws
+    - restart ceph rgws on ubuntu
+    - restart ceph rgws on red hat
 
 - name: create rbd client directory
   file: >