]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
added auto-discovery of OSD disks 148/head
authorIgor Shestakov <shine@selectel.ru>
Thu, 13 Nov 2014 14:19:18 +0000 (17:19 +0300)
committerIgor Shestakov <shine@selectel.ru>
Thu, 13 Nov 2014 14:19:18 +0000 (17:19 +0300)
group_vars/all
roles/ceph-osd/tasks/journal_collocation.yml

index b5d2708bb87882c57fa7420ee9ad33c55e787f6b..7490495c2c10fb197bba5ee1009ed620e42e7cc1 100644 (file)
@@ -33,6 +33,7 @@ dummy:
 
 ## OSD options
 #
+#osd_auto_discovery: true
 #journal_size: 100
 #pool_default_pg_num: 128
 #pool_default_pgp_num: 128
index df2b741a54a62d8c4cab77d4f88e3d42f22d305f..3012ee7fbb03c1788f60f370b2dc7161d54929f1 100644 (file)
 
 # NOTE (alahouze): if the device is a partition, the parted command below has
 # failed, this is why we check if the device is a partition too.
+- name: Automatic prepare OSD disk(s) without partitions
+  command: ceph-disk prepare "/dev/{{ item.key }}"
+  when: ansible_devices is defined and item.value.removable == "0" and item.value.partitions|count == 0 and journal_collocation and osd_auto_discovery
+  ignore_errors: True
+  with_dict: ansible_devices
+  register: prepared_osds
 
-- name: Prepare OSD disk(s)
+- name: Manually Prepare OSD disk(s)
   command: "ceph-disk prepare {{ item.2 }}"
-  when: (item.0.rc != 0 or item.1.rc != 0) and journal_collocation
+  when: (item.0.rc != 0 or item.1.rc != 0) and journal_collocation and not osd_auto_discovery
   ignore_errors: True
   with_together:
     - parted.results