]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
mon: add support for pgp, pool type and rule name
authorSébastien Han <seb@redhat.com>
Tue, 6 Mar 2018 13:22:48 +0000 (14:22 +0100)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 14 Mar 2018 13:22:00 +0000 (14:22 +0100)
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>
group_vars/mons.yml.sample
roles/ceph-mon/defaults/main.yml
roles/ceph-mon/tasks/openstack_config.yml

index 06653e49d58a20ea7322c7ea1e52c16d1d09d455..970879494da655d1137799a918665242e8a65c70 100644 (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:
index 6bb6bfe7376876d5a6ef40a4c117967ada77b3f2..271f2b8e0560af03d29c6ce901c85d7ae5f95526 100644 (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:
index 42c0133dc72fdc4758341fd3c331aee8ffb10cda..209670f9190c9ee2d45eae2057a805f14ad77149 100644 (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