]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-rgw: Fix custom pool size setting
authorBenoît Knecht <bknecht@protonmail.ch>
Mon, 30 Dec 2019 09:53:20 +0000 (10:53 +0100)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Thu, 9 Jan 2020 02:28:03 +0000 (21:28 -0500)
RadosGW pools can be created by setting

```yaml
rgw_create_pools:
  .rgw.root:
    pg_num: 512
    size: 2
```

for instance. However, doing so would create pools of size
`osd_pool_default_size` regardless of the `size` value. This was due to
the fact that the Ansible task used

```
{{ item.size | default(osd_pool_default_size) }}
```

as the pool size value, but `item.size` is always undefined; the
correct variable is `item.value.size`.

Signed-off-by: Benoît Knecht <bknecht@protonmail.ch>
(cherry picked from commit 3c31b19ab39f297635c84edb9e8a5de6c2da7707)

roles/ceph-rgw/tasks/main.yml

index dad3c55042942ed56099e9e46b67bd0e6fcefe3a..65d0dccd5ba3b7bfcfe3b272b194578648d0b24b 100644 (file)
@@ -35,7 +35,7 @@
       run_once: true
 
     - name: customize pool size
-      command: "{{ container_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool set {{ item.key }} size {{ item.size | default(osd_pool_default_size) }}"
+      command: "{{ container_exec_cmd }} ceph --connect-timeout 5 --cluster {{ cluster }} osd pool set {{ item.key }} size {{ item.value.size | default(osd_pool_default_size) }}"
       with_dict: "{{ rgw_create_pools }}"
       delegate_to: "{{ groups[mon_group_name][0] }}"
       changed_when: false