Skip to content

Commit 84a81a1

Browse files
committed
config: use osd_memory_target value from ceph_conf_overrides if defined
otherwise it's impossible to override `osd_memory_target` via `ceph_conf_overrides`. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2056675 Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit f19dcb2)
1 parent 2e09456 commit 84a81a1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

roles/ceph-config/tasks/main.yml

+11-2
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,21 @@
9898
when:
9999
- devices | default([]) | length > 0
100100

101+
- name: set_fact _osd_memory_target
102+
set_fact:
103+
_osd_memory_target: "{{ item }}"
104+
loop:
105+
- "{{ ceph_conf_overrides.get('osd', {}).get('osd memory target', '') }}"
106+
- "{{ ceph_conf_overrides.get('osd', {}).get('osd_memory_target', '') }}"
107+
when:
108+
- item
109+
- item > osd_memory_target
110+
101111
- name: set_fact _osd_memory_target
102112
set_fact:
103113
_osd_memory_target: "{{ ((ansible_facts['memtotal_mb'] * 1048576 * safety_factor | float) / num_osds | float) | int }}"
104114
when:
105-
- not ceph_conf_overrides.get('osd', {}).get('osd_memory_target')
106-
- not ceph_conf_overrides.get('osd', {}).get('osd memory target')
115+
- _osd_memory_target is undefined
107116
- num_osds | default(0) | int > 0
108117
- ((ansible_facts['memtotal_mb'] * 1048576 * safety_factor | float) / num_osds | float) > osd_memory_target
109118

0 commit comments

Comments
 (0)