Puppet Plan: tlsinfo::update

Defined in:
plans/update.pp

Summary

Update certificate and private key

Overview

Update certificate and private key. Works only in conjuction with Hiera

Parameters:

  • targets (TargetSpec)

    Nodes on which certificate should be installed

  • lookupkey (String)

    Certificate for which lookup inside Hiera. In most cases it is subject common name

  • restart_nginx (Boolean) (defaults to: false)

    Flag whether to restart Nginx or not



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'plans/update.pp', line 16

plan tlsinfo::update (
  TargetSpec $targets,
  String     $lookupkey,
  Boolean    $restart_nginx = false,
) {
  run_plan(puppet::agent5::install, $targets)
  run_plan(facts, $targets)

  return apply($targets) {
    include tlsinfo
    tlsinfo::certpair { $lookupkey:
      identity => true,
      cacert   => false,
    }
    if $restart_nginx {
      service { 'nginx':
        ensure    => running,
        subscribe => Tlsinfo::Certpair[$lookupkey],
      }
    }
  }
}