]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-facts: add get default crush rule from running monitor
authorSeena Fallah <seenafallah@gmail.com>
Sun, 27 Sep 2020 17:11:07 +0000 (20:41 +0330)
committerGuillaume Abrioux <gabrioux@redhat.com>
Tue, 29 Sep 2020 14:38:38 +0000 (16:38 +0200)
In case of deploying new monitor node to an existing cluster,
osd_pool_default_crush_rule should be taken from running monitor because
ceph-osd role won't be run and the new monitor will have different
osd_pool_default_crush_role from other monitors.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
(cherry picked from commit ff9f4d138f988d908b5f5583e0c1fcf5dd72e36d)

roles/ceph-facts/tasks/facts.yml

index 2e7e21e67541270eee0d46dfcc07096cff1590fa..9364f2061409475ee98bf71a6ae5bac5a4577bfd 100644 (file)
   changed_when: false
   check_mode: no
   failed_when: false
-  when: ceph_conf.stat.exists
+  when: ceph_conf.stat.exists | bool
+
+- name: get default crush rule value from running monitor ceph configuration
+  command: grep 'osd pool default crush rule' /etc/ceph/{{ cluster }}.conf
+  register: crush_rule_variable
+  changed_when: false
+  check_mode: no
+  failed_when: false
+  run_once: true
+  delegate_to: "{{ running_mon }}"
+  when:
+    - running_mon is defined
+    - not ceph_conf.stat.exists | bool
 
 - name: set_fact osd_pool_default_crush_rule
   set_fact: