diff --git a/group_vars/mons.yml.sample b/group_vars/mons.yml.sample index 5644dc7e1..6f79ae41b 100644 --- a/group_vars/mons.yml.sample +++ b/group_vars/mons.yml.sample @@ -43,14 +43,16 @@ dummy: #crush_rule_hdd: # name: HDD -# root: HDD +# root: default # type: host +# class: hdd # default: false #crush_rule_ssd: # name: SSD -# root: SSD +# root: default # type: host +# class: ssd # default: false #crush_rules: diff --git a/roles/ceph-mon/defaults/main.yml b/roles/ceph-mon/defaults/main.yml index f4460a708..46d20d506 100644 --- a/roles/ceph-mon/defaults/main.yml +++ b/roles/ceph-mon/defaults/main.yml @@ -35,14 +35,16 @@ crush_rule_config: false crush_rule_hdd: name: HDD - root: HDD + root: default type: host + class: hdd default: false crush_rule_ssd: name: SSD - root: SSD + root: default type: host + class: ssd default: false crush_rules: diff --git a/roles/ceph-osd/tasks/crush_rules.yml b/roles/ceph-osd/tasks/crush_rules.yml index 02e5bef51..edeedc1ba 100644 --- a/roles/ceph-osd/tasks/crush_rules.yml +++ b/roles/ceph-osd/tasks/crush_rules.yml @@ -11,7 +11,7 @@ - osd_crush_location is defined - name: create configured crush rules - command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd crush rule create-simple {{ item.name }} {{ item.root }} {{ item.type }}" + command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd crush rule {{ 'create-replicated' if item.class is defined else 'create-simple' }} {{ item.name }} {{ item.root }} {{ item.type }} {{ item.class | default('') }}" changed_when: false with_items: "{{ hostvars[groups[mon_group_name][0]]['crush_rules'] | unique }}" delegate_to: '{{ groups[mon_group_name][0] }}' diff --git a/tests/functional/all_daemons/container/group_vars/mons b/tests/functional/all_daemons/container/group_vars/mons index 4b5405947..7b31aa922 100644 --- a/tests/functional/all_daemons/container/group_vars/mons +++ b/tests/functional/all_daemons/container/group_vars/mons @@ -3,8 +3,9 @@ create_crush_tree: True crush_rule_config: True crush_rule_hdd: name: HDD - root: HDD + root: default type: host + class: hdd default: true crush_rules: - "{{ crush_rule_hdd }}" diff --git a/tests/functional/all_daemons/group_vars/mons b/tests/functional/all_daemons/group_vars/mons index 4b8817342..f6ab9a541 100644 --- a/tests/functional/all_daemons/group_vars/mons +++ b/tests/functional/all_daemons/group_vars/mons @@ -3,8 +3,9 @@ create_crush_tree: True crush_rule_config: True crush_rule_hdd: name: HDD - root: HDD + root: default type: host + class: hdd default: true crush_rules: - "{{ crush_rule_hdd }}" \ No newline at end of file diff --git a/tests/functional/podman/group_vars/mons b/tests/functional/podman/group_vars/mons index 4b5405947..7b31aa922 100644 --- a/tests/functional/podman/group_vars/mons +++ b/tests/functional/podman/group_vars/mons @@ -3,8 +3,9 @@ create_crush_tree: True crush_rule_config: True crush_rule_hdd: name: HDD - root: HDD + root: default type: host + class: hdd default: true crush_rules: - "{{ crush_rule_hdd }}"