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 }}"
|
2019-09-11 06:01:48 +08:00
|
|
|
with_dict: "{{ rgw_create_pools }}"
|
|
|
|
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 }}"
|
2019-09-11 06:01:48 +08:00
|
|
|
with_dict: "{{ rgw_create_pools }}"
|
|
|
|
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 }}"
|
2019-09-11 06:01:48 +08:00
|
|
|
with_dict: "{{ rgw_create_pools }}"
|
|
|
|
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-02-20 22:49:17 +08:00
|
|
|
command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd pool create {{ item.key }} {{ item.value.pg_num | default(osd_pool_default_pg_num) }} erasure {{ item.value.ec_profile }}"
|
2019-09-11 06:01:48 +08:00
|
|
|
with_dict: "{{ rgw_create_pools }}"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
- item.value.type is defined
|
|
|
|
- item.value.type == 'ec'
|
|
|
|
|
|
|
|
- name: create replicated pools for rgw
|
2020-02-20 22:49:17 +08:00
|
|
|
command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd pool create {{ item.key }} {{ item.value.pg_num | default(osd_pool_default_pg_num) }} replicated"
|
2019-09-11 06:01:48 +08:00
|
|
|
changed_when: false
|
2020-03-06 15:06:37 +08:00
|
|
|
register: result
|
|
|
|
retries: 60
|
|
|
|
delay: 3
|
|
|
|
until: result is succeeded
|
2019-09-11 06:01:48 +08:00
|
|
|
with_dict: "{{ rgw_create_pools }}"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
when: item.value.type is not defined or item.value.type == 'replicated'
|
|
|
|
|
|
|
|
- name: customize replicated pool size
|
2020-03-11 08:50:55 +08:00
|
|
|
command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd pool set {{ item.key }} size {{ item.value.size | default(osd_pool_default_size) }} {{ '--yes-i-really-mean-it' if item.value.size | default(osd_pool_default_size) | int == 1 else '' }}"
|
2020-03-06 15:06:37 +08:00
|
|
|
register: result
|
|
|
|
retries: 60
|
|
|
|
delay: 3
|
|
|
|
until: result is succeeded
|
2019-09-11 06:01:48 +08:00
|
|
|
with_dict: "{{ rgw_create_pools }}"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|
|
|
|
changed_when: false
|
|
|
|
when:
|
|
|
|
- item.value.type is not defined or item.value.type == 'replicated'
|
|
|
|
- item.value.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
|
|
|
|
|
|
|
|
- name: set the rgw_create_pools pools application to rgw
|
2020-02-20 22:49:17 +08:00
|
|
|
command: "{{ container_exec_cmd }} ceph --connect-timeout 10 --cluster {{ cluster }} osd pool application enable {{ item.key }} rgw"
|
2020-03-06 15:06:37 +08:00
|
|
|
register: result
|
|
|
|
retries: 60
|
|
|
|
delay: 3
|
|
|
|
until: result is succeeded
|
2019-09-11 06:01:48 +08:00
|
|
|
changed_when: false
|
|
|
|
with_dict: "{{ rgw_create_pools }}"
|
|
|
|
delegate_to: "{{ groups[mon_group_name][0] }}"
|