File: x509.pp

package info (click to toggle)
puppet-module-magnum 25.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,180 kB
  • sloc: ruby: 2,768; python: 38; makefile: 21; sh: 10
file content (46 lines) | stat: -rw-r--r-- 1,371 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
# == Class: magnum::x509
#
# Manages the magnum x509 config
#
# === Parameters:
#
# [*allow_ca*]
#   (optional) Certificate can get the CA flag in x509 extensions.
#   Defaults to $facts['os_service_default']
#
# [*allowed_extensions*]
#   (optional) List of allowed x509 extensions.
#   Defaults to $facts['os_service_default']
#
# [*allowed_key_usage*]
#   (optional) List of allowed x509 key usage.
#   Defaults to $facts['os_service_default']
#
# [*term_of_validity*]
#   (optional) Number of days for which a certificate is valid.
#   Defaults to $facts['os_service_default']
#
# [*rsa_key_size*]
#   (optional) Size of generated private key.
#   Defaults to $facts['os_service_default']
#
class magnum::x509 (
  $allow_ca           = $facts['os_service_default'],
  $allowed_extensions = $facts['os_service_default'],
  $allowed_key_usage  = $facts['os_service_default'],
  $term_of_validity   = $facts['os_service_default'],
  $rsa_key_size       = $facts['os_service_default'],
) {

  include magnum::deps

  magnum_config {
    'x509/allow_ca':           value => $allow_ca;
    'x509/allowed_extensions': value => join(any2array($allowed_extensions), ',');
    'x509/allowed_key_usage':  value => join(any2array($allowed_key_usage), ',');
    'x509/term_of_validity':   value => $term_of_validity;
    'x509/rsa_key_size':       value => $rsa_key_size;
  }

}