2019-09-11 06:01:48 +08:00
|
|
|
---
|
2020-11-05 21:59:33 +08:00
|
|
|
- name: create ec profile
|
|
|
|
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 }}"
|
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
|
|
|
|
|
|
|
- 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'
|
|
|
|
|
|
|
|
- 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) }}"
|
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
|
|
|
|
|
|
|
- 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) }}"
|
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 }}"
|