File: init.pp

package info (click to toggle)
puppet-module-placement 12.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 644 kB
  • sloc: ruby: 1,516; python: 38; makefile: 10; sh: 10
file content (61 lines) | stat: -rw-r--r-- 1,812 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# == Class: placement
#
# Full description of class placement here.
#
# === Parameters
#
# [*ensure_package*]
#   (Optional) The state of nova packages
#   Defaults to 'present'
#
# [*sync_db*]
#   (Optional) Run db sync on the node.
#   Defaults to true
#
# [*state_path*]
#   (optional) Directory for storing state.
#   Defaults to $facts['os_service_default']
#
# [*randomize_allocation_candidates*]
#   (Optional) Randomize the results of the returned
#   allocation candidates.
#   Defaults to $facts['os_service_default']
#
# [*allocation_conflict_retry_count*]
#   (Optional) The number of retries when confliction is detected in concurrent
#   allocations.
#   Defaults to $facts['os_service_default']
#
class placement(
  $ensure_package                  = 'present',
  Boolean $sync_db                 = true,
  $state_path                      = $facts['os_service_default'],
  $randomize_allocation_candidates = $facts['os_service_default'],
  $allocation_conflict_retry_count = $facts['os_service_default'],
) inherits placement::params {

  include placement::deps

  if $sync_db {
    include placement::db::sync
  }

  package { 'python-placement':
    ensure => $ensure_package,
    name   => $::placement::params::python_package_name,
    tag    => ['openstack', 'placement-package'],
  }

  package { 'placement-common':
    ensure  => $ensure_package,
    name    => $::placement::params::common_package_name,
    require => Package['python-placement'],
    tag     => ['openstack', 'placement-package'],
  }

  placement_config {
    'DEFAULT/state_path'                       : value => $state_path;
    'placement/randomize_allocation_candidates': value => $randomize_allocation_candidates;
    'placement/allocation_conflict_retry_count': value => $allocation_conflict_retry_count;
  }
}