mon: add support for pgp, pool type and rule name

When creating pools, it's crucial to expose all the options available as
part of the pool creation command. As explained in:
http://docs.ceph.com/docs/jewel/rados/operations/pools/

Signed-off-by: Sébastien Han <seb@redhat.com>
pull/2450/head
Sébastien Han 2018-03-06 14:22:48 +01:00 committed by Guillaume Abrioux
parent 4806ff4ff8
commit 277d885bc9
3 changed files with 38 additions and 11 deletions

View File

@ -89,27 +89,37 @@ dummy:
#openstack_glance_pool:
# name: images
# pg_num: "{{ osd_pool_default_pg_num }}"
# rule_name: ""
# pgp_num: "{{ osd_pool_default_pg_num }}"
# type: replicated
# rule_name: "0"
# size: ""
#openstack_cinder_pool:
# name: volumes
# pg_num: "{{ osd_pool_default_pg_num }}"
# rule_name: ""
# pgp_num: "{{ osd_pool_default_pg_num }}"
# type: replicated
# rule_name: "0"
# size: ""
#openstack_nova_pool:
# name: vms
# pg_num: "{{ osd_pool_default_pg_num }}"
# rule_name: ""
# pgp_num: "{{ osd_pool_default_pg_num }}"
# type: replicated
# rule_name: "0"
# size: ""
#openstack_cinder_backup_pool:
# name: backups
# pg_num: "{{ osd_pool_default_pg_num }}"
# rule_name: ""
# pgp_num: "{{ osd_pool_default_pg_num }}"
# type: replicated
# rule_name: "0"
# size: ""
#openstack_gnocchi_pool:
# name: metrics
# pg_num: "{{ osd_pool_default_pg_num }}"
# rule_name: ""
# pgp_num: "{{ osd_pool_default_pg_num }}"
# type: replicated
# rule_name: "0"
# size: ""
#openstack_pools:

View File

@ -81,27 +81,37 @@ openstack_config: false
openstack_glance_pool:
name: images
pg_num: "{{ osd_pool_default_pg_num }}"
rule_name: ""
pgp_num: "{{ osd_pool_default_pg_num }}"
type: replicated
rule_name: "0"
size: ""
openstack_cinder_pool:
name: volumes
pg_num: "{{ osd_pool_default_pg_num }}"
rule_name: ""
pgp_num: "{{ osd_pool_default_pg_num }}"
type: replicated
rule_name: "0"
size: ""
openstack_nova_pool:
name: vms
pg_num: "{{ osd_pool_default_pg_num }}"
rule_name: ""
pgp_num: "{{ osd_pool_default_pg_num }}"
type: replicated
rule_name: "0"
size: ""
openstack_cinder_backup_pool:
name: backups
pg_num: "{{ osd_pool_default_pg_num }}"
rule_name: ""
pgp_num: "{{ osd_pool_default_pg_num }}"
type: replicated
rule_name: "0"
size: ""
openstack_gnocchi_pool:
name: metrics
pg_num: "{{ osd_pool_default_pg_num }}"
rule_name: ""
pgp_num: "{{ osd_pool_default_pg_num }}"
type: replicated
rule_name: "0"
size: ""
openstack_pools:

View File

@ -1,6 +1,13 @@
---
- name: create openstack pool(s)
command: "{{ docker_exec_cmd }} ceph --cluster {{ cluster }} osd pool create {{ item.name }} {{ item.pg_num }} {{ item.rule_name|default('') }} {{ item.size|default('') }}"
command: >
"{{ docker_exec_cmd }} ceph --cluster {{ cluster }}
osd pool create {{ item.name }}
{{ item.pg_num }}
{{ item.pgp_num | default(item.pg_num) }}
{{ item.rule_name|default("0") }}
{{ item.type|default("replicated") }}
{{ item.size|default('') }}"
with_items: "{{ openstack_pools | unique }}"
changed_when: false