]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
make systemd enable work for osd instance
authorHuamin Chen <hchen@redhat.com>
Tue, 12 Jan 2016 20:41:51 +0000 (20:41 +0000)
committerHuamin Chen <hchen@redhat.com>
Wed, 13 Jan 2016 00:40:56 +0000 (00:40 +0000)
Signed-off-by: Huamin Chen <hchen@redhat.com>
roles/ceph-mon/tasks/start_monitor.yml
roles/ceph-osd/tasks/activate_osds.yml

index 620fa276ba2ec5a6b7c92f871faf75d86fd06ddb..9bda52c5e4a94355f9e49e56ff36d03e0c4380de 100644 (file)
@@ -47,8 +47,9 @@
     not is_ceph_infernalis
 
 - name: enable systemd unit file for mon instance (for or after infernalis)
-  command: "ln -s /usr/lib/systemd/system/ceph-mon@.service /etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service"
+  file: src=/usr/lib/systemd/system/ceph-mon@.service dest=/etc/systemd/system/multi-user.target.wants/ceph-mon@{{ ansible_hostname }}.service state=link
   changed_when: false
+  failed_when: false
   when:
     ansible_distribution != "Ubuntu" and
     is_ceph_infernalis
index 21f2fc3e3a063100f31d73bb09b308c891bd75be..d93c0861e1b210652fbe50966e7b4ea2ca9b3c65 100644 (file)
     ansible_distribution != "Ubuntu" and
     not is_ceph_infernalis
 
+- name: get osd id (for or after infernalis)
+  shell: "ls /var/lib/ceph/osd/ |grep -oh '[0-9]*'"
+  changed_when: false
+  failed_when: false
+  register: osd_id
+  when:
+    ansible_distribution != "Ubuntu" and
+    is_ceph_infernalis
+
+- name: enable osd service instance(s) (for or after infernalis)
+  file:  src=/usr/lib/systemd/system/ceph-osd@.service dest=/etc/systemd/system/multi-user.target.wants/ceph-osd@{{ item }}.service state=link
+  with_items: osd_id.stdout_lines
+  failed_when: false
+  when:
+    ansible_distribution != "Ubuntu" and
+    is_ceph_infernalis
+
 - name: start and add that the osd service(s) to the init sequence (for or after infernalis)
   service:
-    name: ceph.target
+    name: ceph-osd@{{ item }}
     state: started
     enabled: yes
+  with_items: osd_id.stdout_lines
+  changed_when: false
   when:
     ansible_distribution != "Ubuntu" and
     is_ceph_infernalis