]> 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)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Fri, 10 Jan 2020 16:07:25 +0000 (11:07 -0500)
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>
(cherry picked from commit cf8c6a384999be8caedce1121dfd57ae114d5bb6)

roles/ceph-osd/tasks/main.yml
roles/ceph-osd/tasks/openstack_config.yml

index 84df01483c7e9ddd8504160c2f9eb6236868fb6a..070bc6674bf5bb7e8ac13ce22164006bde301861 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"]["osdmap"]["num_osds"] | int > 0
+    - (wait_for_all_osds_up.stdout | from_json)["osdmap"]["osdmap"]["num_osds"] == (wait_for_all_osds_up.stdout | from_json)["osdmap"]["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 f8e340ee4bf392957ed696b3aca90797dd9c2680..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"]["osdmap"]["num_osds"] | int > 0
-    - (wait_for_all_osds_up.stdout | from_json)["osdmap"]["osdmap"]["num_osds"] == (wait_for_all_osds_up.stdout | from_json)["osdmap"]["osdmap"]["num_up_osds"]
-
 - name: pool related tasks
   block:
     - name: list existing pool(s)