From 559e3b921d72f32436ee7718e90b68b9ded82761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Mon, 2 Mar 2015 17:13:30 +0100 Subject: [PATCH] Improve Handler support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now proper commands/actions are used per hosts and groups. Signed-off-by: Sébastien Han --- roles/ceph-common/handlers/main.yml | 24 ++++++++++++++++++------ roles/ceph-common/tasks/main.yml | 7 +++++-- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/roles/ceph-common/handlers/main.yml b/roles/ceph-common/handlers/main.yml index ac61a1b9f..d6bf1cfc5 100644 --- a/roles/ceph-common/handlers/main.yml +++ b/roles/ceph-common/handlers/main.yml @@ -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 diff --git a/roles/ceph-common/tasks/main.yml b/roles/ceph-common/tasks/main.yml index debd7aa4c..96a9b5f7f 100644 --- a/roles/ceph-common/tasks/main.yml +++ b/roles/ceph-common/tasks/main.yml @@ -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