Convert ceph_pools into a hash type
authorGiulio Fidente <gfidente@redhat.com>
Mon, 25 Jul 2016 13:09:16 +0000 (15:09 +0200)
committerGiulio Fidente <gfidente@redhat.com>
Mon, 8 Aug 2016 14:41:14 +0000 (14:41 +0000)
By using create_resources we can create ceph::pool resources from
a hash. This will make it possible to define custom attributes
for the single pool from the heat templates.

Change-Id: I38978f0f3119e4ab7dd45021e598253cb066cb5a

manifests/profile/base/ceph/mon.pp

index 48c3721..b211120 100644 (file)
 # === Parameters
 #
 # [*ceph_pools*]
-#   (Optional) List of pools to create
-#   Defaults to []
+#   (Optional) Hash of pools to create
+#   Example with hiera:
+#     tripleo::profile::base::ceph::mon::ceph_pools:
+#       mypool:
+#         size: 5
+#         pg_num: 128
+#         pgp_num: 128
+#   Defaults to {}
 #
 # [*step*]
 #   (Optional) The current step in deployment. See tripleo-heat-templates
@@ -28,7 +34,7 @@
 #   Defaults to hiera('step')
 #
 class tripleo::profile::base::ceph::mon (
-  $ceph_pools = [],
+  $ceph_pools = {},
   $step       = hiera('step'),
 ) {
 
@@ -39,10 +45,6 @@ class tripleo::profile::base::ceph::mon (
   }
 
   if $step >= 4 {
-    ceph::pool { $ceph_pools :
-      pg_num  => hiera('ceph::profile::params::osd_pool_default_pg_num'),
-      pgp_num => hiera('ceph::profile::params::osd_pool_default_pgp_num'),
-      size    => hiera('ceph::profile::params::osd_pool_default_size'),
-    }
+    create_resources('ceph::pool', $ceph_pools)
   }
 }