ceph-config: fix overriding osd_memory_target

When the value is overriding in `ceph_conf_overrides`, there is no need to calculate and set `osd_memory_target` again as we wanted to override the conf by our desired value.

Signed-off-by: Seena Fallah <seenafallah@gmail.com>
pull/7333/head
Seena Fallah 2022-09-24 19:46:20 +02:00 committed by Guillaume Abrioux
parent 57b0890aff
commit 613773b2a3
2 changed files with 3 additions and 3 deletions

View File

@ -97,9 +97,9 @@
- name: set osd related config facts - name: set osd related config facts
when: inventory_hostname in groups.get(osd_group_name, []) when: inventory_hostname in groups.get(osd_group_name, [])
block: block:
- name: set_fact osd_memory_target, override from ceph_conf_overrides - name: set_fact _osd_memory_target, override from ceph_conf_overrides
set_fact: set_fact:
osd_memory_target: "{{ item }}" _osd_memory_target: "{{ item }}"
loop: loop:
- "{{ ceph_conf_overrides.get('osd', {}).get('osd memory target', '') }}" - "{{ ceph_conf_overrides.get('osd', {}).get('osd memory target', '') }}"
- "{{ ceph_conf_overrides.get('osd', {}).get('osd_memory_target', '') }}" - "{{ ceph_conf_overrides.get('osd', {}).get('osd_memory_target', '') }}"
@ -109,6 +109,7 @@
set_fact: set_fact:
_osd_memory_target: "{{ ((ansible_facts['memtotal_mb'] * 1048576 * safety_factor | float) / num_osds | float) | int }}" _osd_memory_target: "{{ ((ansible_facts['memtotal_mb'] * 1048576 * safety_factor | float) / num_osds | float) | int }}"
when: when:
- _osd_memory_target is undefined
- num_osds | default(0) | int > 0 - num_osds | default(0) | int > 0
- ((ansible_facts['memtotal_mb'] * 1048576 * safety_factor | float) / num_osds | float) > (osd_memory_target | float) - ((ansible_facts['memtotal_mb'] * 1048576 * safety_factor | float) / num_osds | float) > (osd_memory_target | float)

View File

@ -80,7 +80,6 @@ filestore xattr use omap = true
{% endif %} {% endif %}
{% endif %} {% endif %}
{% if osd_objectstore == 'bluestore' %} {% if osd_objectstore == 'bluestore' %}
{% set _num_osds = num_osds | default(0) | int %}
[osd] [osd]
osd memory target = {{ _osd_memory_target | default(osd_memory_target) }} osd memory target = {{ _osd_memory_target | default(osd_memory_target) }}
{% endif %} {% endif %}