File: inventory.pp

package info (click to toggle)
puppet-module-ironic 27.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,612 kB
  • sloc: ruby: 5,990; python: 33; makefile: 10; sh: 10
file content (33 lines) | stat: -rw-r--r-- 885 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
# == Class: ironic::inventory
#
# Configure the inventory parameters
#
# === Parameters
#
# [*data_backend*]
#  (Optional) The storage backend for storing introspection data.
#  Defaults to $facts['os_service_default'].
#
# [*swift_data_container*]
#  (Optional) The Swift introspection data container to store the inventory
#  data.
#  Defaults to $facts['os_service_default'].
#
class ironic::inventory (
  $data_backend         = $facts['os_service_default'],
  $swift_data_container = $facts['os_service_default'],
) {
  include ironic::deps
  include ironic::params

  if ! is_service_default($data_backend) {
    if ! member(['none', 'database', 'swift'], $data_backend) {
      fail('Unsupported data backend')
    }
  }

  ironic_config {
    'inventory/data_backend':         value => $data_backend;
    'inventory/swift_data_container': value => $swift_data_container;
  }
}