From ef344c3d40063a9c91939f0e56bf58715d077ac4 Mon Sep 17 00:00:00 2001 From: Nate Potter Date: Tue, 8 Mar 2016 17:31:59 +0000 Subject: [PATCH] Add glance multi/single store declaration examples This patch adds examples to explain the new multiple store backend declaration feature and how to use it. It covers both the case where the user wants to declare multiple backends as well as just one. Change-Id: Ief8fea9d57422d05d36bf9b6946695249958aad9 Depends-on: I28a79ae36e673a3537ea16910d338666b65c80f7 --- examples/glance_multi_store.pp | 25 +++++++++++++++++++++++++ examples/glance_single_store.pp | 18 ++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 examples/glance_multi_store.pp create mode 100644 examples/glance_single_store.pp diff --git a/examples/glance_multi_store.pp b/examples/glance_multi_store.pp new file mode 100644 index 00000000..4983f283 --- /dev/null +++ b/examples/glance_multi_store.pp @@ -0,0 +1,25 @@ +# Example: Declaring multiple backend stores +# +# To declare multiple glance::backend::* classes, each declaration must include +# the parameter multi_store set to true. This prevents each individual backend from +# setting itself as the default store as soon as it is declared. Rather, the +# default store can be chosen by the user when declaring glance::api (if no +# default_store is set at that point, then the first store in the list 'stores' +# provided will be made the default). + +class { '::glance::backend::file': + multi_store => true, +} + +class { '::glance::backend::swift': + swift_store_user => 'demo', + swift_store_key => 'secrete', + multi_store => true, +} + +class { '::glance::api': + keystone_password => 'a_big_secret', + stores => ['file', 'swift'], + default_store => 'swift', + multi_store => true, +} diff --git a/examples/glance_single_store.pp b/examples/glance_single_store.pp new file mode 100644 index 00000000..2ca2d3f6 --- /dev/null +++ b/examples/glance_single_store.pp @@ -0,0 +1,18 @@ +# Example: Declaring a single backend store +# +# To declare only one glance::backend::* class, all you need to do is declare +# it without the multi_store parameter. This way, multi_store will default to false +# and the glance::backend::* class will automatically set itself as the default backend. +# After doing this, you must not declare glance::api with multi_store set to true, +# or it will attempt to override the default set by the backend class and result +# in an error. + +class { '::glance::backend::swift': + swift_store_user => 'demo', + swift_store_key => 'secrete', +} + +class { '::glance::api': + keystone_password => 'a_big_secret', + stores => ['swift'], +}