]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
osd: do not change pool size on erasure pool
authorGuillaume Abrioux <gabrioux@redhat.com>
Tue, 3 Mar 2020 09:47:19 +0000 (10:47 +0100)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Wed, 4 Mar 2020 14:29:01 +0000 (09:29 -0500)
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>
roles/ceph-client/tasks/create_users_keys.yml
roles/ceph-mds/tasks/create_mds_filesystems.yml
roles/ceph-osd/tasks/openstack_config.yml

index 04942f1784b31dc5ca196aaebe17bfb4e73e6a24..ccfe5578c2072dad5e31276e332118c950856641 100644 (file)
       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
       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 }}"
index e571bd6edb38a7086367bdcd9e6042a133db101d..e3a54e8c26175bfa490b07df8a2c81304509f410 100644 (file)
           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 }}"
index 2dcfbd6e16c126a0b1a24be5fabe9d1b426ecb32..a8539aff0c29b063ec60f81e3c4415812ec96607 100644 (file)
       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: >
       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 }}"