From cb70d4975113e41f63b420665e9873711cf41074 Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 5 May 2016 14:54:50 -0500 Subject: [PATCH] Use the use_systemd fact when starting mdss Signed-off-by: Andrew Schoen --- roles/ceph-common/handlers/main.yml | 8 +++----- roles/ceph-mds/tasks/pre_requisite.yml | 18 +++++++++--------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/roles/ceph-common/handlers/main.yml b/roles/ceph-common/handlers/main.yml index 3b4ba2f5f..fa73ca397 100644 --- a/roles/ceph-common/handlers/main.yml +++ b/roles/ceph-common/handlers/main.yml @@ -74,10 +74,9 @@ when: socket.rc == 0 and ansible_distribution != 'Ubuntu' and - not use_systemd and + use_systemd and mds_group_name in group_names and - ceph_stable and - ceph_stable_release in ceph_stable_releases + is_before_infernalis - name: restart ceph mdss with systemd service: @@ -87,8 +86,7 @@ socket.rc == 0 and use_systemd and mds_group_name in group_names and - ceph_stable and - ceph_stable_release not in ceph_stable_releases + is_after_hammer - name: restart ceph rgws on ubuntu command: initctl restart radosgw cluster={{ cluster }} id=rgw.{{ ansible_hostname }} diff --git a/roles/ceph-mds/tasks/pre_requisite.yml b/roles/ceph-mds/tasks/pre_requisite.yml index be9c0478e..fadae0155 100644 --- a/roles/ceph-mds/tasks/pre_requisite.yml +++ b/roles/ceph-mds/tasks/pre_requisite.yml @@ -63,7 +63,7 @@ - done - upstart changed_when: false - when: ansible_distribution == "Ubuntu" + when: not use_systemd - name: activate metadata server with sysvinit file: @@ -76,7 +76,7 @@ - done - sysvinit changed_when: false - when: ansible_distribution != "Ubuntu" + when: use_systemd - name: enable systemd unit file for mds instance (for or after infernalis) file: @@ -86,16 +86,16 @@ changed_when: false failed_when: false when: - ansible_distribution != "Ubuntu" and + use_systemd and is_after_hammer -- name: start and add that the metadata service to the init sequence (ubuntu) +- name: start and add that the metadata service to the init sequence (upstart) command: initctl emit ceph-mds cluster={{ cluster }} id={{ mds_name }} changed_when: false failed_when: false - when: ansible_distribution == "Ubuntu" + when: not use_systemd -- name: start and add that the metadata service to the init sequence (before infernalis) +- name: start and add that the metadata service to the init sequence (systemd before infernalis) service: name: ceph state: started @@ -103,15 +103,15 @@ args: mds.{{ mds_name }} changed_when: false when: - ansible_distribution != "Ubuntu" and + use_systemd and is_before_infernalis -- name: start and add that the metadata service to the init sequence (for or after infernalis) +- name: start and add that the metadata service to the init sequence (systemd after hammer) service: name: ceph-mds@{{ mds_name }} state: started enabled: yes changed_when: false when: - ansible_distribution != "Ubuntu" and + use_systemd and is_after_hammer