From b81392d1c98b9d09a4be9f7c25b7486a48df01e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Han?= Date: Sat, 30 Aug 2014 02:34:11 +0200 Subject: [PATCH] Fix restart on config change handler MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Prior to this patch, the first match was winning and the playbook wasn't doing any difference both "restart ceph", adding a distro filtrer fixes this. Signed-off-by: Sébastien Han --- roles/ceph-common/handlers/main.yml | 8 ++++---- roles/ceph-common/tasks/Debian.yml | 8 +++++++- roles/ceph-common/tasks/RedHat.yml | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/roles/ceph-common/handlers/main.yml b/roles/ceph-common/handlers/main.yml index 44be529ad..7de099f7c 100644 --- a/roles/ceph-common/handlers/main.yml +++ b/roles/ceph-common/handlers/main.yml @@ -3,10 +3,10 @@ - name: "update apt cache" action: apt update-cache=yes -- name: "restart ceph" +- name: "restart ceph ubuntu" shell: service ceph restart ; service ceph-osd-all restart - when: socket.rc == 0 and ansible_distribution == 'Ubuntu' + when: socket.rc == 0 -- name: "restart ceph" +- name: "restart ceph debian redhat" command: service ceph restart - when: socket.rc == 0 and ansible_distribution == 'Debian' or ansible_os_family == 'RedHat' + when: socket.rc == 0 diff --git a/roles/ceph-common/tasks/Debian.yml b/roles/ceph-common/tasks/Debian.yml index c4ceaf353..4bddb8bc9 100644 --- a/roles/ceph-common/tasks/Debian.yml +++ b/roles/ceph-common/tasks/Debian.yml @@ -44,7 +44,13 @@ - name: Generate Ceph configuration file template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644 - notify: restart ceph + notify: restart ceph ubuntu + when: ansible_distribution == 'Ubuntu' + +- name: Generate Ceph configuration file + template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644 + notify: restart ceph debian redhat + when: ansible_distribution == 'Debian' or ansible_os_family == 'RedHat' - name: Disable OSD directory parsing by updatedb command: updatedb -e /var/lib/ceph diff --git a/roles/ceph-common/tasks/RedHat.yml b/roles/ceph-common/tasks/RedHat.yml index eddcb5274..02c9069f7 100644 --- a/roles/ceph-common/tasks/RedHat.yml +++ b/roles/ceph-common/tasks/RedHat.yml @@ -37,7 +37,7 @@ - name: Generate Ceph configuration file template: src=ceph.conf.j2 dest=/etc/ceph/ceph.conf owner=root group=root mode=0644 - notify: restart ceph + notify: restart ceph debian redhat - name: Disable OSD directory parsing by updatedb command: updatedb -e /var/lib/ceph -- 2.39.5