Puppet Class: certs::apache
- Inherits:
- certs
- Defined in:
- manifests/apache.pp
Overview
Certs configurations for Apache
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 |
# File 'manifests/apache.pp', line 2
class certs::apache (
Stdlib::Fqdn $hostname = $certs::node_fqdn,
Array[Stdlib::Fqdn] $cname = $certs::cname,
Boolean $generate = $certs::generate,
Boolean $regenerate = $certs::regenerate,
Boolean $deploy = $certs::deploy,
Stdlib::Absolutepath $pki_dir = $certs::pki_dir,
Optional[Stdlib::Absolutepath] $server_cert = $certs::server_cert,
Optional[Stdlib::Absolutepath] $server_key = $certs::server_key,
Optional[Stdlib::Absolutepath] $server_cert_req = $certs::server_cert_req,
String[2,2] $country = $certs::country,
String $state = $certs::state,
String $city = $certs::city,
String $org = $certs::org,
String $org_unit = $certs::org_unit,
String $expiration = $certs::expiration,
Type[Ca] $default_ca = $certs::default_ca,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
String $group = $certs::group,
) inherits certs {
$apache_cert_name = "${hostname}-apache"
$apache_cert = "${pki_dir}/certs/katello-apache.crt"
$apache_key = "${pki_dir}/private/katello-apache.key"
# This variable is unused but considered public API
$apache_ca_cert = $certs::katello_server_ca_cert
if $server_cert {
cert { $apache_cert_name:
ensure => present,
hostname => $hostname,
cname => $cname,
generate => $generate,
deploy => false,
regenerate => $regenerate,
custom_pubkey => $server_cert,
custom_privkey => $server_key,
custom_req => $server_cert_req,
build_dir => $certs::ssl_build_dir,
}
} else {
cert { $apache_cert_name:
ensure => present,
hostname => $hostname,
cname => $cname,
country => $country,
state => $state,
city => $city,
org => $org,
org_unit => $org_unit,
expiration => $expiration,
ca => $default_ca,
generate => $generate,
regenerate => $regenerate,
deploy => false,
password_file => $ca_key_password_file,
build_dir => $certs::ssl_build_dir,
}
}
if $deploy {
certs::keypair { $apache_cert_name:
source_dir => "${certs::ssl_build_dir}/${hostname}",
key_file => $apache_key,
key_owner => 'root',
key_group => $group,
key_mode => '0440',
cert_file => $apache_cert,
cert_owner => 'root',
cert_group => $group,
cert_mode => '0440',
require => Cert[$apache_cert_name],
}
}
}
|