File: backends.pp

package info (click to toggle)
puppet-module-cinder 27.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,512 kB
  • sloc: ruby: 6,697; python: 33; sh: 10; makefile: 10
file content (37 lines) | stat: -rw-r--r-- 1,029 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# == Class: cinder::backends
#
# Class to set the enabled_backends list
#
# === Parameters
#
# [*enabled_backends*]
#   (Required) a list of ini sections to enable.
#   This should contain names used in cinder::backend::* resources.
#   Example: ['volume1', 'volume2', 'sata3']
#   Defaults to undef
#
# [*backend_host*]
#   (optional) Backend override of host value.
#   Defaults to $facts['os_service_default']
#
# Author: Andrew Woodward <awoodward@mirantis.com>
class cinder::backends (
  Array[String[1], 1] $enabled_backends,
  $backend_host     = $facts['os_service_default'],
) {
  include cinder::deps

  # Maybe this could be extended to dynamically find the enabled names
  cinder_config {
    'DEFAULT/enabled_backends': value => join($enabled_backends, ',');
  }

  $enabled_backends.each |$backend| {
    # Avoid colliding with code in backend/rbd.pp
    unless defined(Cinder_config["${backend}/backend_host"]) {
      cinder_config {
        "${backend}/backend_host": value => $backend_host;
      }
    }
  }
}