2017-02-24 17:22:16 +08:00
|
|
|
# NOTE(leseb): we add a conditional for backward compatibility
|
|
|
|
# so people that had 'pool_default_pg_num' declared will get
|
|
|
|
# the same behaviour
|
|
|
|
#
|
|
|
|
- name: get default value for osd_pool_default_pg_num
|
|
|
|
shell: |
|
2017-10-03 19:55:27 +08:00
|
|
|
{{ docker_exec_cmd }} ceph --cluster {{ cluster }} daemon mon.{{ monitor_name }} config get osd_pool_default_pg_num
|
2017-02-24 17:22:16 +08:00
|
|
|
failed_when: false
|
|
|
|
changed_when: false
|
|
|
|
run_once: true
|
|
|
|
register: default_pool_default_pg_num
|
2017-10-03 19:55:27 +08:00
|
|
|
when:
|
|
|
|
- pool_default_pg_num is not defined
|
|
|
|
- ceph_conf_overrides.get('global', {}).get('osd_pool_default_pg_num', False) == False
|
2017-02-24 17:22:16 +08:00
|
|
|
|
2017-10-03 19:55:27 +08:00
|
|
|
- name: set_fact osd_pool_default_pg_num with pool_default_pg_num (backward compatibility)
|
2017-09-15 06:48:53 +08:00
|
|
|
set_fact:
|
2017-02-24 17:22:16 +08:00
|
|
|
osd_pool_default_pg_num: "{{ pool_default_pg_num }}"
|
|
|
|
when: pool_default_pg_num is defined
|
|
|
|
|
2017-10-03 19:55:27 +08:00
|
|
|
- name: set_fact osd_pool_default_pg_num with default_pool_default_pg_num.stdout
|
2017-09-15 06:48:53 +08:00
|
|
|
set_fact:
|
2017-10-03 19:55:27 +08:00
|
|
|
osd_pool_default_pg_num: "{{ (default_pool_default_pg_num.stdout | from_json).osd_pool_default_pg_num }}"
|
2017-02-24 17:22:16 +08:00
|
|
|
when:
|
2017-10-03 19:55:27 +08:00
|
|
|
- default_pool_default_pg_num.get('rc') == 0
|
2017-02-24 17:22:16 +08:00
|
|
|
|
2017-09-15 06:48:53 +08:00
|
|
|
- name: set_fact osd_pool_default_pg_num ceph_conf_overrides.global.osd_pool_default_pg_num
|
|
|
|
set_fact:
|
2017-02-24 17:22:16 +08:00
|
|
|
osd_pool_default_pg_num: "{{ ceph_conf_overrides.global.osd_pool_default_pg_num }}"
|
|
|
|
when:
|
2017-10-03 19:55:27 +08:00
|
|
|
- ceph_conf_overrides.get('global', {}).get('osd_pool_default_pg_num', False) != False
|