File: housekeeping.pp

package info (click to toggle)
puppet-module-octavia 25.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,588 kB
  • sloc: ruby: 3,940; python: 38; makefile: 12; sh: 10
file content (87 lines) | stat: -rw-r--r-- 2,768 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# Installs and configures the octavia housekeeping service
#
# == Parameters
#
# [*enabled*]
#   (optional) Should the service be enabled.
#   Defaults to true
#
# [*manage_service*]
#   (optional) Whether the service should be managed by Puppet.
#   Defaults to true.
#
# [*package_ensure*]
#   (optional) ensure state for package.
#   Defaults to 'present'
#
# [*cleanup_interval*]
#   (optional) DB cleanup interval in seconds.
#   Defaults to $facts['os_service_default']
#
# [*amphora_expiry_age*]
#   (optional) Amphora expiry age in seconds.
#   Defaults to $facts['os_service_default']
#
# [*load_balancer_expiry_age*]
#   (optional) Load balancer expiry age in seconds.
#   Defaults to $facts['os_service_default']
#
# [*cert_interval*]
#   (optional) Certificate check interval in seconds.
#   Defaults to $facts['os_service_default']
#
# [*cert_expiry_buffer*]
#   (optional) Seconds until certificate expiry.
#   Defaults to $facts['os_service_default']
#
# [*cert_rotate_threads*]
#   (optional) Number of threads performing amphora certificate rotation.
#   Defaults to $facts['os_service_default']
#
class octavia::housekeeping (
  Boolean $manage_service    = true,
  Boolean $enabled           = true,
  $package_ensure            = 'present',
  $cleanup_interval          = $facts['os_service_default'],
  $amphora_expiry_age        = $facts['os_service_default'],
  $load_balancer_expiry_age  = $facts['os_service_default'],
  $cert_interval             = $facts['os_service_default'],
  $cert_expiry_buffer        = $facts['os_service_default'],
  $cert_rotate_threads       = $facts['os_service_default'],
) {

  include octavia::deps
  include octavia::params

  package { 'octavia-housekeeping':
    ensure => $package_ensure,
    name   => $::octavia::params::housekeeping_package_name,
    tag    => ['openstack', 'octavia-package'],
  }

  if $manage_service {
    if $enabled {
      $service_ensure = 'running'
    } else {
      $service_ensure = 'stopped'
    }

    service { 'octavia-housekeeping':
      ensure     => $service_ensure,
      name       => $::octavia::params::housekeeping_service_name,
      enable     => $enabled,
      hasstatus  => true,
      hasrestart => true,
      tag        => ['octavia-service'],
    }
  }

  octavia_config {
    'house_keeping/cleanup_interval'           : value => $cleanup_interval;
    'house_keeping/amphora_expiry_age'         : value => $amphora_expiry_age;
    'house_keeping/load_balancer_expiry_age'   : value => $load_balancer_expiry_age;
    'house_keeping/cert_interval'              : value => $cert_interval;
    'house_keeping/cert_expiry_buffer'         : value => $cert_expiry_buffer;
    'house_keeping/cert_rotate_threads'        : value => $cert_rotate_threads;
  }
}