From: Andrew Schoen Date: Thu, 5 May 2016 20:00:47 +0000 (-0500) Subject: Use the use_systemd fact when starting rbd X-Git-Tag: ceph-ansible-1.0.5-33~49 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f702fb4190ab6f5b0dc5a85d578d7a954acfebc5;p=ceph-ansible.git Use the use_systemd fact when starting rbd Signed-off-by: Andrew Schoen (cherry picked from commit 8baf8830d6348c280c3a86a7d2f6d53c5f509c88) --- diff --git a/roles/ceph-rbd-mirror/tasks/start_rbd_mirror.yml b/roles/ceph-rbd-mirror/tasks/start_rbd_mirror.yml index 92a47ccc4..b325a759c 100644 --- a/roles/ceph-rbd-mirror/tasks/start_rbd_mirror.yml +++ b/roles/ceph-rbd-mirror/tasks/start_rbd_mirror.yml @@ -1,20 +1,20 @@ --- -- name: start and add that the rbd mirror service to the init sequence (ubuntu) +- name: start and add that the rbd mirror service to the init sequence (upstart) command: initctl emit ceph-rbd-mirror cluster={{ cluster }} id={{ ansible_hostname }} changed_when: false failed_when: false - when: ansible_distribution == "Ubuntu" + when: not use_systemd # NOTE (leseb): somehow the service ansible module is messing things up # as a safety measure we run the raw command -- name: start and add that the rbd mirror service to the init sequence +- name: start and add that the rbd mirror service to the init sequence (systemd before infernalis) command: service ceph start ceph-rbd-mirror changed_when: false when: - ansible_distribution != "Ubuntu" and + use_systemd and is_before_infernalis -- name: enable systemd unit file for the rbd mirror service (for or after infernalis) +- name: enable systemd unit file for the rbd mirror service (systemd after hammer) file: src: /usr/lib/systemd/system/ceph-rbd-mirror@.service dest: "/etc/systemd/system/multi-user.target.wants/ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}.service" @@ -22,15 +22,15 @@ changed_when: false failed_when: false when: - ansible_distribution != "Ubuntu" and + use_systemd and is_after_hammer -- name: start and add that the rbd mirror service to the init sequence (for or after infernalis) +- name: start and add that the rbd mirror service to the init sequence (systemd after hammer) service: name: "ceph-rbd-mirror@{{ ceph_rbd_mirror_local_user }}" state: started enabled: yes changed_when: false when: - ansible_distribution != "Ubuntu" and + use_systemd and is_after_hammer