]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-osd: wait for all osd before crush rules
authorDimitri Savineau <dsavinea@redhat.com>
Tue, 26 Nov 2019 16:09:11 +0000 (11:09 -0500)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 27 Nov 2019 06:43:07 +0000 (07:43 +0100)
When creating crush rules with device class parameter we need to be sure
that all OSDs are up and running because the device class list is
is populated with this information.
This is now enable for all scenario not openstack_config only.

Signed-off-by: Dimitri Savineau <dsavinea@redhat.com>
roles/ceph-osd/tasks/main.yml
roles/ceph-osd/tasks/openstack_config.yml

index 84df01483c7e9ddd8504160c2f9eb6236868fb6a..b931a4ec7842f3405fe37d3b8d3818a017b492ef 100644 (file)
 - name: include_tasks start_osds.yml
   include_tasks: start_osds.yml
 
+- name: wait for all osd to be up
+  command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} -s -f json"
+  register: wait_for_all_osds_up
+  retries: "{{ nb_retry_wait_osd_up }}"
+  delay: "{{ delay_wait_osd_up }}"
+  changed_when: false
+  delegate_to: "{{ groups[mon_group_name][0] }}"
+  until:
+    - (wait_for_all_osds_up.stdout | from_json)["osdmap"]["num_osds"] | int > 0
+    - (wait_for_all_osds_up.stdout | from_json)["osdmap"]["num_osds"] == (wait_for_all_osds_up.stdout | from_json)["osdmap"]["num_up_osds"]
+
 - name: include crush_rules.yml
   include_tasks: crush_rules.yml
   when: hostvars[groups[mon_group_name][0]]['crush_rule_config'] | default(false) | bool
index 796c3c533fbb065a1599fe65a49667bdd2d1c6cd..b465210cb3afc257605a1bdc88cf3d3479522fd0 100644 (file)
@@ -1,15 +1,4 @@
 ---
-- name: wait for all osd to be up
-  command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} -s -f json"
-  register: wait_for_all_osds_up
-  retries: "{{ nb_retry_wait_osd_up }}"
-  delay: "{{ delay_wait_osd_up }}"
-  changed_when: false
-  delegate_to: "{{ groups[mon_group_name][0] }}"
-  until:
-    - (wait_for_all_osds_up.stdout | from_json)["osdmap"]["num_osds"] | int > 0
-    - (wait_for_all_osds_up.stdout | from_json)["osdmap"]["num_osds"] == (wait_for_all_osds_up.stdout | from_json)["osdmap"]["num_up_osds"]
-
 - name: pool related tasks
   block:
     - name: list existing pool(s)