2019-09-11 06:01:48 +08:00
|
|
|
---
|
|
|
|
- name: remove ec profile
|
2020-02-20 22:49:17 +08:00
|
|
|
command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd erasure-code-profile rm {{ item.value.ec_profile }}"
|
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] }}"
|
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
- item.value.type is defined
|
|
|
|
- item.value.type == 'ec'
|
|
|
|
failed_when: false
|
|
|
|
|
|
|
|
- name: set ec profile
|
2020-02-20 22:49:17 +08:00
|
|
|
command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd erasure-code-profile set {{ item.value.ec_profile }} k={{ item.value.ec_k }} m={{ item.value.ec_m }}"
|
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] }}"
|
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
- item.value.type is defined
|
|
|
|
- item.value.type == 'ec'
|
|
|
|
|
|
|
|
- name: set crush rule
|
2020-02-20 22:49:17 +08:00
|
|
|
command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd crush rule create-erasure {{ item.key }} {{ item.value.ec_profile }}"
|
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] }}"
|
|
|
|
changed_when: false
|
|
|
|
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 }}"
|
|
|
|
pg_num: "{{ item.value.pg_num | default(osd_pool_default_pg_num) }}"
|
|
|
|
pgp_num: "{{ item.value.pg_num | default(osd_pool_default_pg_num) }}"
|
|
|
|
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 }}"
|
|
|
|
pg_num: "{{ item.value.pg_num | default(osd_pool_default_pg_num) }}"
|
|
|
|
pgp_num: "{{ item.value.pg_num | default(osd_pool_default_pg_num) }}"
|
2020-09-26 03:01:16 +08:00
|
|
|
size: "{{ item.value.size | default(osd_pool_default_size) }}"
|
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 }}"
|