2019-09-11 06:01:48 +08:00
---
2024-02-14 18:14:02 +08:00
- name : Create ec profile
2020-11-05 21:59:33 +08:00
ceph_ec_profile :
name : "{{ item.value.ec_profile }}"
2020-12-12 03:18:51 +08:00
cluster : "{{ cluster }}"
2024-03-14 22:49:31 +08:00
k : "{{ item.value.ec_k | default(omit) }}"
m : "{{ item.value.ec_m | default(omit) }}"
2021-10-26 22:00:05 +08:00
crush_device_class : "{{ item.value.ec_crush_device_class | default(omit) }}"
2019-09-11 06:01:48 +08:00
delegate_to : "{{ groups[mon_group_name][0] }}"
2020-05-11 21:49:32 +08:00
loop : "{{ rgw_create_pools | dict2items }}"
2019-09-11 06:01:48 +08:00
when :
2024-03-14 22:49:31 +08:00
- item.value.create_profile | default(true)
- item.value.type | default('') == 'ec'
2020-11-05 21:59:33 +08:00
environment :
CEPH_CONTAINER_IMAGE : "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY : "{{ container_binary }}"
2019-09-11 06:01:48 +08:00
2024-02-14 18:14:02 +08:00
- name : Set crush rule
2020-11-10 01:16:41 +08:00
ceph_crush_rule :
name : "{{ item.key }}"
cluster : "{{ cluster }}"
rule_type : erasure
profile : "{{ item.value.ec_profile }}"
environment :
CEPH_CONTAINER_IMAGE : "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
CEPH_CONTAINER_BINARY : "{{ container_binary }}"
2020-05-11 21:49:32 +08:00
loop : "{{ rgw_create_pools | dict2items }}"
2019-09-11 06:01:48 +08:00
delegate_to : "{{ groups[mon_group_name][0] }}"
when :
2024-03-14 22:49:31 +08:00
- item.value.create_profile | default(true)
- item.value.type | default('') == 'ec'
2019-09-11 06:01:48 +08:00
2024-03-14 22:49:31 +08:00
- name : Create rgw pools
2020-09-10 06:38:33 +08:00
ceph_pool :
name : "{{ item.key }}"
2020-09-26 03:01:16 +08:00
state : present
2020-09-10 06:38:33 +08:00
cluster : "{{ cluster }}"
2020-09-29 05:27:47 +08:00
pg_num : "{{ item.value.pg_num | default(omit) }}"
pgp_num : "{{ item.value.pgp_num | default(omit) }}"
size : "{{ item.value.size | default(omit) }}"
min_size : "{{ item.value.min_size | default(omit) }}"
2021-05-05 22:39:02 +08:00
pg_autoscale_mode : "{{ item.value.pg_autoscale_mode | default(omit) }}"
2020-12-16 14:33:36 +08:00
target_size_ratio : "{{ item.value.target_size_ratio | default(omit) }}"
2024-03-14 22:49:31 +08:00
pool_type : "{{ 'erasure' if item.value.type | default('') == 'ec' else 'replicated' }}"
erasure_profile : "{{ item.value.ec_profile | default(omit) }}"
rule_name : "{{ item.value.rule_name if item.value.rule_name is defined else item.key if item.value.type | default('') == 'ec' else ceph_osd_pool_default_crush_rule_name }}"
2020-09-10 06:38:33 +08:00
application : rgw
2020-05-11 21:49:32 +08:00
loop : "{{ rgw_create_pools | dict2items }}"
2019-09-11 06:01:48 +08:00
delegate_to : "{{ groups[mon_group_name][0] }}"
2020-09-10 06:38:33 +08:00
environment :
2020-09-26 00:15:02 +08:00
CEPH_CONTAINER_IMAGE : "{{ ceph_docker_registry + '/' + ceph_docker_image + ':' + ceph_docker_image_tag if containerized_deployment | bool else None }}"
2020-09-10 06:38:33 +08:00
CEPH_CONTAINER_BINARY : "{{ container_binary }}"