Puppet Class: cfssl::initca

Defined in:
modules/cfssl/manifests/initca.pp

Overview

Parameters:

  • ca_name (String)
  • ca_config (Hash)


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
# File 'modules/cfssl/manifests/initca.pp', line 2

class cfssl::initca (
    String $ca_name,
    Hash $ca_config,
) {
    include cfssl

    $safe_title = $ca_name.regsubst('[^\w\-]', '_', 'G')
    $csr_path = "${cfssl::csr_dir}/${safe_title}.csr"
    $ca_file = $cfssl::ca_file
    $ca_key_file = $cfssl::ca_key_file

    cfssl::csr {$ca_name:
        sign => false,
        *    => $ca_config,
    }
    file {'/usr/local/sbin/cfssl_initca':
        ensure  => file,
        owner   => 'root',
        mode    => '0500',
        content => template('cfssl/initca.sh.erb'),
    }
    exec {'/usr/local/sbin/cfssl_initca':
        creates => $ca_key_file,
        require => File['/usr/local/sbin/cfssl_initca'],
    }
}