]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
Add systemd-specific start/restart tasks/handlers for el7/infernalis 440/head
authorEike Frost <ei@kefro.st>
Fri, 20 Nov 2015 21:34:29 +0000 (22:34 +0100)
committerEike Frost <ei@kefro.st>
Fri, 20 Nov 2015 21:34:29 +0000 (22:34 +0100)
roles/ceph-common/handlers/main.yml
roles/ceph-common/tasks/main.yml
roles/ceph-mds/tasks/pre_requisite.yml
roles/ceph-mon/tasks/start_monitor.yml
roles/ceph-osd/tasks/activate_osds.yml
roles/ceph-rgw/tasks/start_radosgw.yml

index 1821c62b74f72b6618699a803e4ba15e2d4a63a7..ef109b0b6d5915569dd7ac78b26e85a127d6a46b 100644 (file)
@@ -8,7 +8,26 @@
   when:
     socket.rc == 0 and
     ansible_distribution != 'Ubuntu' and
-    mon_group_name in group_names
+    mon_group_name in group_names and
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
+
+- name: restart ceph mons with systemd
+  service:
+      name: ceph-mon@{{ ansible_hostname }}
+      state: restarted
+  when:
+    socket.rc == 0 and
+    ansible_distribution != 'Ubuntu' and
+    mon_group_name in group_names and not
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
 
 - name: restart ceph mons on ubuntu
   command: restart ceph-mon-all
   when:
     socket.rc == 0 and
     ansible_distribution != 'Ubuntu' and
-    osd_group_name in group_names
+    osd_group_name in group_names and
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
+
+# This does not just restart OSDs but everything else too. Unfortunately
+# at this time the ansible role does not have an OSD id list to use
+# for restarting them specifically.
+- name: restart ceph osds with systemd
+  service:
+    name: ceph.target
+    state: restarted
+  when:
+    socket.rc == 0 and
+    ansible_distribution != 'Ubuntu' and
+    osd_group_name in group_names and not
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
 
 - name: restart ceph osds on ubuntu
   command: restart ceph-osd-all
   when:
     socket.rc == 0 and
     ansible_distribution != 'Ubuntu' and
-    mds_group_name in group_names
+    mds_group_name in group_names and
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
+
+
+- name: restart ceph mdss with systemd
+  service:
+      name: ceph-mds@{{ ansible_hostname }}
+      state: restarted
+  when:
+    socket.rc == 0 and
+    ansible_distribution != 'Ubuntu' and
+    mds_group_name in group_names and not
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
 
 - 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
+    rgw_group_name in group_names and
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
 
 - 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
+    rgw_group_name in group_names and
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
+
+- name: restart ceph rgws with systemd
+  service:
+    name: ceph-rgw@{{ ansible_hostname }}
+    state: restarted
+  when:
+    socketrgw.rc == 0 and
+    ansible_distribution != 'Ubuntu' and
+    rgw_group_name in group_names and not
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
 
 - name: restart apache2
   service:
index 3eab4498aef0c347436d88cc3c66c4f25f004743..adae3e641c859530ab4d7d87640c558d83a82d89 100644 (file)
   notify:
     - restart ceph mons
     - restart ceph mons on ubuntu
+    - restart ceph mons with systemd
     - restart ceph osds
     - restart ceph osds on ubuntu
+    - restart ceph osds with systemd
     - restart ceph mdss
     - restart ceph mdss on ubuntu
+    - restart ceph mdss with systemd
     - restart ceph rgws
     - restart ceph rgws on ubuntu
     - restart ceph rgws on red hat
+    - restart ceph rgws with systemd
 
 - name: create rbd client directory
   file:
index 236c17f13adf2f7a8e525420b9264a91ef79456b..7d348422204a8b4ce7f334a220229b3a9cb740fc 100644 (file)
   changed_when: false
   when: ansible_distribution == "Ubuntu"
 
-- name: start and add that the metadata service to the init sequence
+- name: start and add that the metadata service to the init sequence (before infernalis)
   service:
     name: ceph
     state: started
     enabled: yes
     args: mds
   changed_when: false
-  when: ansible_distribution != "Ubuntu"
+  when: ansible_distribution != "Ubuntu" and
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
+
+
+- name: start and add that the metadata service to the init sequence (for or after infernalis)
+  service:
+    name: ceph-mds@{{ ansible_hostname }}
+    state: started
+    enabled: yes
+  changed_when: false
+  when: ansible_distribution != "Ubuntu" and not
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
index 59f7ec25971a1b8167277bdc810ad800b7ec0759..ed4a3aedf49e94ad06683e31450253d0847aaaf9 100644 (file)
 - name: start and add that the monitor service to the init sequence
   command: service ceph start mon
   changed_when: false
-  when: ansible_distribution != "Ubuntu"
+  when:
+    ansible_distribution != "Ubuntu" and
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
+
+- name: start and add that the monitor service to the init sequence (for or after infernalis)
+  service:
+      name: ceph-mon@{{ ansible_hostname }}
+      state: started
+      enabled: yes
+  changed_when: false
+  when:
+    ansible_distribution != "Ubuntu" and not
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
 
 - name: collect admin and bootstrap keys
   command: ceph-create-keys --id {{ ansible_hostname }}
index babccbaa4c669ef1cc38bbfddaa802072d6cb371..d3cfe900fd1bb14897050e10a8b5854ba88fab1b 100644 (file)
 - include: osd_fragment.yml
   when: crush_location
 
-- name: start and add that the osd service(s) to the init sequence
+- name: start and add that the osd service(s) to the init sequence (before infernalis)
   service:
     name: ceph
     state: started
     enabled: yes
+  when:
+    ansible_distribution == "Ubuntu" or
+    (ceph_stable_release == 'dumpling' or
+     ceph_stable_release == 'emperor' or
+     ceph_stable_release == 'firefly' or
+     ceph_stable_release == 'giant' or
+     ceph_stable_release == 'hammer')
+
+- name: start and add that the osd service(s) to the init sequence (on or after infernalis)
+  service:
+    name: ceph.target
+    state: started
+    enabled: yes
+  when:
+    ansible_distribution != "Ubuntu" and not
+    (ceph_stable_release == 'dumpling' or
+     ceph_stable_release == 'emperor' or
+     ceph_stable_release == 'firefly' or
+     ceph_stable_release == 'giant' or
+     ceph_stable_release == 'hammer')
+
index cc5d1f694adb13241eb354861fb91ed786c0fbf3..ef5dc98d705a1a6aaf7c83734a002d568123108a 100644 (file)
     state: started
   when: ansible_distribution == 'Ubuntu'
 
-- name: start rgw on red hat
+- name: start rgw on red hat (before or on infernalis)
   service:
     name: ceph-radosgw
     state: started
     enabled: yes
-  when: ansible_os_family == 'RedHat'
+  when: ansible_os_family == 'RedHat' and
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')
+
+- name: start rgw on red hat (after infernalis)
+  service:
+    name: ceph-radosgw@{{ ansible_hostname }}
+    state: started
+    enabled: yes
+  when: ansible_os_family == 'RedHat' and not
+    (ceph_stable_release == 'dumpling' or
+    ceph_stable_release == 'emperor' or
+    ceph_stable_release == 'firefly' or
+    ceph_stable_release == 'giant' or
+    ceph_stable_release == 'hammer')