From 9b40aa5692c82ce25c0127bea4567d9e62b51a52 Mon Sep 17 00:00:00 2001 From: Xingchao Yu Date: Thu, 3 Apr 2014 18:26:21 +0800 Subject: [PATCH] Introduce cinder:config to manage custom options This cinder::config is aim to use cinder config resources to manage custom configurations in cinder config files. This will make end user easy to add their own custom options in Hiera data. Fully implements blueprint cinder-custom-config Change-Id: I58faf3f4c76b2eb2077552036a239b60103ee965 --- manifests/config.pp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 manifests/config.pp diff --git a/manifests/config.pp b/manifests/config.pp new file mode 100644 index 00000000..0fa29a3e --- /dev/null +++ b/manifests/config.pp @@ -0,0 +1,39 @@ +# == Class: cinder::config +# +# This class is used to manage arbitrary cinder configurations. +# +# === Parameters +# +# [*xxx_config*] +# (optional) Allow configuration of arbitrary cinder configurations. +# The value is an hash of xxx_config resources. Example: +# { 'DEFAULT/foo' => { value => 'fooValue'}, +# 'DEFAULT/bar' => { value => 'barValue'} +# } +# +# In yaml format, Example: +# xxx_config: +# DEFAULT/foo: +# value: fooValue +# DEFAULT/bar: +# value: barValue +# +# [**cinder_config**] +# (optional) Allow configuration of cinder.conf configurations. +# +# [**api_paste_ini_config**] +# (optional) Allow configuration of /etc/cinder/api-paste.ini configurations. +# +# NOTE: The configuration MUST NOT be already handled by this module +# or Puppet catalog compilation will fail with duplicate resources. +# +class cinder::config ( + $cinder_config = {}, + $api_paste_ini_config = {}, +) { + validate_hash($cinder_config) + validate_hash($api_paste_ini_config) + + create_resources('cinder_config', $cinder_config) + create_resources('cinder_api_paste_ini', $api_paste_ini_config) +}