Skip to content

Commit

Permalink
config: use osd_memory_target value from ceph_conf_overrides if defined
Browse files Browse the repository at this point in the history
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 <[email protected]>
(cherry picked from commit f19dcb2)
  • Loading branch information
guits committed Aug 11, 2022
1 parent 2e09456 commit 84a81a1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions roles/ceph-config/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,21 @@
when:
- devices | default([]) | length > 0

- name: set_fact _osd_memory_target
set_fact:
_osd_memory_target: "{{ item }}"
loop:
- "{{ ceph_conf_overrides.get('osd', {}).get('osd memory target', '') }}"
- "{{ ceph_conf_overrides.get('osd', {}).get('osd_memory_target', '') }}"
when:
- item
- item > osd_memory_target

- name: set_fact _osd_memory_target
set_fact:
_osd_memory_target: "{{ ((ansible_facts['memtotal_mb'] * 1048576 * safety_factor | float) / num_osds | float) | int }}"
when:
- not ceph_conf_overrides.get('osd', {}).get('osd_memory_target')
- not ceph_conf_overrides.get('osd', {}).get('osd memory target')
- _osd_memory_target is undefined
- num_osds | default(0) | int > 0
- ((ansible_facts['memtotal_mb'] * 1048576 * safety_factor | float) / num_osds | float) > osd_memory_target

Expand Down

0 comments on commit 84a81a1

Please sign in to comment.