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 }}"
|
2020-11-05 21:59:33 +08:00
|
|
|
k: "{{ item.value.ec_k }}"
|
|
|
|
m: "{{ item.value.ec_m }}"
|
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:
|
|
|
|
- item.value.type is defined
|
|
|
|
- item.value.type == '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:
|
|
|
|
- item.value.type is defined
|
|
|
|
- item.value.type == 'ec'
|
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create ec pools for rgw
|
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) }}"
|
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) }}"
|
2020-09-10 06:38:33 +08:00
|
|
|
pool_type: erasure
|
|
|
|
erasure_profile: "{{ item.value.ec_profile }}"
|
|
|
|
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] }}"
|
|
|
|
when:
|
|
|
|
- item.value.type is defined
|
|
|
|
- item.value.type == 'ec'
|
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 }}"
|
2019-09-11 06:01:48 +08:00
|
|
|
|
2024-02-14 18:14:02 +08:00
|
|
|
- name: Create replicated pools for rgw
|
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) }}"
|
2020-09-10 06:38:33 +08:00
|
|
|
pool_type: replicated
|
2020-09-26 03:01:16 +08:00
|
|
|
rule_name: "{{ item.value.rule_name | default(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] }}"
|
|
|
|
when: item.value.type is not defined or item.value.type == 'replicated'
|
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 }}"
|