osd: do not change pool size on erasure pool

This commit adds condition in order to not try to customize pools size
when its type is erasure.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
pull/4545/head
Guillaume Abrioux 2020-03-03 10:47:19 +01:00 committed by Dimitri Savineau
parent 8cacba1f54
commit e17c79b871
3 changed files with 20 additions and 4 deletions

View File

@ -122,6 +122,8 @@
changed_when: false
when:
- pools | length > 0
- item.type | default(1) | int != 3
- item.type | default('replicated') != 'erasure'
- item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
- name: customize pool min_size
@ -134,6 +136,8 @@
when:
- pools | length > 0
- (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
- item.type | default(1) | int != 3
- item.type | default('replicated') != 'erasure'
- name: assign application to pool(s)
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}"

View File

@ -54,13 +54,19 @@
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} size {{ item.size | default(osd_pool_default_size) }}"
with_items: "{{ cephfs_pools | unique }}"
changed_when: false
when: item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
when:
- item.size | default(osd_pool_default_size) != ceph_osd_pool_default_size
- item.type | default(1) | int != 3
- item.type | default('replicated') != 'erasure'
- name: customize pool min_size
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool set {{ item.name }} min_size {{ item.min_size | default(osd_pool_default_min_size) }}"
with_items: "{{ cephfs_pools | unique }}"
changed_when: false
when: (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
when:
- (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
- item.type | default(1) | int != 3
- item.type | default('replicated') != 'erasure'
- name: assign application to cephfs pools
command: "{{ container_exec_cmd | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}"

View File

@ -50,7 +50,10 @@
with_items: "{{ openstack_pools | unique }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false
when: item.size | default(osd_pool_default_size)
when:
- item.size | default(osd_pool_default_size)
- item.type | default(1) | int != 3
- item.type | default('replicated') != 'erasure'
- name: customize pool min_size
command: >
@ -59,7 +62,10 @@
with_items: "{{ openstack_pools | unique }}"
delegate_to: "{{ groups[mon_group_name][0] }}"
changed_when: false
when: (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
when:
- (item.min_size | default(osd_pool_default_min_size))|int > ceph_osd_pool_default_min_size
- item.type | default(1) | int != 3
- item.type | default('replicated') != 'erasure'
- name: assign application to pool(s)
command: "{{ hostvars[groups[mon_group_name][0]]['container_exec_cmd'] | default('') }} ceph --cluster {{ cluster }} osd pool application enable {{ item.name }} {{ item.application }}"