Project

General

Profile

« Previous | Next » 

Revision 51a84139

Added by Eric Helms almost 3 years ago

Add types for parameters for all classes

View differences:

manifests/apache.pp
# Certs configurations for Apache
class certs::apache (
$hostname = $certs::node_fqdn,
$cname = $certs::cname,
$generate = $certs::generate,
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,
$pki_dir = $certs::pki_dir,
$server_cert = $certs::server_cert,
$server_key = $certs::server_key,
$server_cert_req = $certs::server_cert_req,
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$org = $certs::org,
$org_unit = $certs::org_unit,
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,
$group = $certs::group,
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,
$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"
manifests/ca.pp
# == Class: certs
# Sets up the CA for Katello
class certs::ca (
$default_ca_name = $certs::default_ca_name,
$server_ca_name = $certs::server_ca_name,
$ca_common_name = $certs::ca_common_name,
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$org = $certs::org,
$org_unit = $certs::org_unit,
$ca_expiration = $certs::ca_expiration,
$generate = $certs::generate,
$deploy = $certs::deploy,
$server_cert = $certs::server_cert,
$ssl_build_dir = $certs::ssl_build_dir,
$group = $certs::group,
$katello_server_ca_cert = $certs::katello_server_ca_cert,
$ca_key = $certs::ca_key,
$ca_cert = $certs::ca_cert,
$ca_cert_stripped = $certs::ca_cert_stripped,
$ca_key_password = $certs::ca_key_password,
$ca_key_password_file = $certs::ca_key_password_file,
String $default_ca_name = $certs::default_ca_name,
String $server_ca_name = $certs::server_ca_name,
Stdlib::Fqdn $ca_common_name = $certs::ca_common_name,
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 $ca_expiration = $certs::ca_expiration,
Boolean $generate = $certs::generate,
Boolean $deploy = $certs::deploy,
Optional[Stdlib::Absolutepath] $server_cert = $certs::server_cert,
Optional[Stdlib::Absolutepath] $ssl_build_dir = $certs::ssl_build_dir,
String $group = $certs::group,
Stdlib::Absolutepath $katello_server_ca_cert = $certs::katello_server_ca_cert,
Stdlib::Absolutepath $ca_key = $certs::ca_key,
Stdlib::Absolutepath $ca_cert = $certs::ca_cert,
Stdlib::Absolutepath $ca_cert_stripped = $certs::ca_cert_stripped,
String $ca_key_password = $certs::ca_key_password,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
) {
file { $ca_key_password_file:
manifests/candlepin.pp
# Constains certs specific configurations for candlepin
class certs::candlepin (
$hostname = $certs::node_fqdn,
$cname = $certs::cname,
$generate = $certs::generate,
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,
$ca_cert = $certs::candlepin_ca_cert,
$ca_key = $certs::candlepin_ca_key,
$pki_dir = $certs::pki_dir,
$keystore = $certs::candlepin_keystore,
$keystore_password_file = 'keystore_password-file',
$truststore = $certs::candlepin_truststore,
$truststore_password_file = 'truststore_password-file',
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$org = $certs::org,
$org_unit = $certs::org_unit,
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,
$user = $certs::user,
$group = 'tomcat',
$client_keypair_group = 'tomcat',
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 $ca_cert = $certs::candlepin_ca_cert,
Stdlib::Absolutepath $ca_key = $certs::candlepin_ca_key,
Stdlib::Absolutepath $pki_dir = $certs::pki_dir,
Stdlib::Absolutepath $keystore = $certs::candlepin_keystore,
String $keystore_password_file = 'keystore_password-file',
Stdlib::Absolutepath $truststore = $certs::candlepin_truststore,
String $truststore_password_file = 'truststore_password-file',
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,
$default_ca = $certs::default_ca,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
String $user = $certs::user,
String $group = 'tomcat',
String $client_keypair_group = 'tomcat',
) inherits certs {
include certs::foreman
manifests/config.pp
# Certs Configuration
class certs::config (
$pki_dir = $certs::pki_dir,
$group = $certs::group,
Stdlib::Absolutepath $pki_dir = $certs::pki_dir,
String $group = $certs::group,
) {
file { $pki_dir:
manifests/foreman.pp
# Handles Foreman certs configuration
class certs::foreman (
$hostname = $certs::node_fqdn,
$cname = $certs::cname,
$generate = $certs::generate,
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,
$client_cert = '/etc/foreman/client_cert.pem',
$client_key = '/etc/foreman/client_key.pem',
$ssl_ca_cert = '/etc/foreman/proxy_ca.pem',
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$org = 'FOREMAN',
$org_unit = 'PUPPET',
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,
$server_ca = $certs::server_ca,
$owner = 'root',
$group = 'foreman',
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 $client_cert = '/etc/foreman/client_cert.pem',
Stdlib::Absolutepath $client_key = '/etc/foreman/client_key.pem',
Stdlib::Absolutepath $ssl_ca_cert = '/etc/foreman/proxy_ca.pem',
String[2,2] $country = $certs::country,
String $state = $certs::state,
String $city = $certs::city,
String $org = 'FOREMAN',
String $org_unit = 'PUPPET',
String $expiration = $certs::expiration,
$default_ca = $certs::default_ca,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
$server_ca = $certs::server_ca,
String $owner = 'root',
String $group = 'foreman',
) inherits certs {
$client_cert_name = "${hostname}-foreman-client"
manifests/foreman_proxy.pp
# @param $public_key_mode
# The mode used on public key files (which are owned by root:$group).
class certs::foreman_proxy (
$hostname = $certs::node_fqdn,
$cname = $certs::cname,
$generate = $certs::generate,
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,
$proxy_cert = '/etc/foreman-proxy/ssl_cert.pem',
$proxy_key = '/etc/foreman-proxy/ssl_key.pem',
$proxy_ca_cert = '/etc/foreman-proxy/ssl_ca.pem',
$foreman_ssl_cert = '/etc/foreman-proxy/foreman_ssl_cert.pem',
$foreman_ssl_key = '/etc/foreman-proxy/foreman_ssl_key.pem',
$foreman_ssl_ca_cert = '/etc/foreman-proxy/foreman_ssl_ca.pem',
$pki_dir = $certs::pki_dir,
$server_ca = $certs::server_ca,
$server_cert = $certs::server_cert,
$server_key = $certs::server_key,
$server_cert_req = $certs::server_cert_req,
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,
$group = 'foreman-proxy',
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 $proxy_cert = '/etc/foreman-proxy/ssl_cert.pem',
Stdlib::Absolutepath $proxy_key = '/etc/foreman-proxy/ssl_key.pem',
Stdlib::Absolutepath $proxy_ca_cert = '/etc/foreman-proxy/ssl_ca.pem',
Stdlib::Absolutepath $foreman_ssl_cert = '/etc/foreman-proxy/foreman_ssl_cert.pem',
Stdlib::Absolutepath $foreman_ssl_key = '/etc/foreman-proxy/foreman_ssl_key.pem',
Stdlib::Absolutepath $foreman_ssl_ca_cert = '/etc/foreman-proxy/foreman_ssl_ca.pem',
Stdlib::Absolutepath $pki_dir = $certs::pki_dir,
$server_ca = $certs::server_ca,
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 $expiration = $certs::expiration,
$default_ca = $certs::default_ca,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
String $group = 'foreman-proxy',
Stdlib::Filemode $private_key_mode = '0440',
Stdlib::Filemode $public_key_mode = '0444',
) inherits certs {
manifests/pulp_client.pp
# Pulp Client Certs
class certs::pulp_client (
$hostname = $certs::node_fqdn,
$cname = $certs::cname,
$generate = $certs::generate,
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,
$common_name = 'admin',
$pki_dir = $certs::pki_dir,
$ca_cert = $certs::ca_cert,
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,
$group = $certs::group,
Stdlib::Fqdn $hostname = $certs::node_fqdn,
Array[Stdlib::Fqdn] $cname = $certs::cname,
Boolean $generate = $certs::generate,
Boolean $regenerate = $certs::regenerate,
Boolean $deploy = $certs::deploy,
String $common_name = 'admin',
Stdlib::Absolutepath $pki_dir = $certs::pki_dir,
Stdlib::Absolutepath $ca_cert = $certs::ca_cert,
String[2,2] $country = $certs::country,
String $state = $certs::state,
String $city = $certs::city,
String $expiration = $certs::expiration,
$default_ca = $certs::default_ca,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
String $group = $certs::group,
) inherits certs {
$client_cert_name = 'pulp-client'
manifests/puppet.pp
# Class for handling Puppet cert configuration
class certs::puppet (
$hostname = $certs::node_fqdn,
$cname = $certs::cname,
$generate = $certs::generate,
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,
$client_cert = $certs::puppet_client_cert,
$client_key = $certs::puppet_client_key,
$ssl_ca_cert = $certs::puppet_ssl_ca_cert,
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,
$server_ca = $certs::server_ca,
$pki_dir = $certs::pki_dir,
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 $client_cert = $certs::puppet_client_cert,
Stdlib::Absolutepath $client_key = $certs::puppet_client_key,
Stdlib::Absolutepath $ssl_ca_cert = $certs::puppet_ssl_ca_cert,
String[2,2] $country = $certs::country,
String $state = $certs::state,
String $city = $certs::city,
String $expiration = $certs::expiration,
$default_ca = $certs::default_ca,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
$server_ca = $certs::server_ca,
Stdlib::Absolutepath $pki_dir = $certs::pki_dir,
) inherits certs {
$puppet_client_cert_name = "${hostname}-puppet-client"
manifests/qpid.pp
# Handles Qpid cert configuration
class certs::qpid (
$hostname = $certs::node_fqdn,
$cname = $certs::cname,
$generate = $certs::generate,
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$org_unit = $certs::org_unit,
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,
$pki_dir = $certs::pki_dir,
$ca_cert = $certs::ca_cert,
$qpidd_group = 'qpidd',
$nss_cert_name = 'broker',
Stdlib::Fqdn $hostname = $certs::node_fqdn,
Array[Stdlib::Fqdn] $cname = $certs::cname,
Boolean $generate = $certs::generate,
Boolean $regenerate = $certs::regenerate,
Boolean $deploy = $certs::deploy,
String[2,2] $country = $certs::country,
String $state = $certs::state,
String $city = $certs::city,
String $org_unit = $certs::org_unit,
String $expiration = $certs::expiration,
$default_ca = $certs::default_ca,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
Stdlib::Absolutepath $pki_dir = $certs::pki_dir,
Stdlib::Absolutepath $ca_cert = $certs::ca_cert,
String $qpidd_group = 'qpidd',
String $nss_cert_name = 'broker',
) inherits certs {
$qpid_cert_name = "${hostname}-qpid-broker"
manifests/qpid_router/client.pp
# Constains certs specific configurations for qpid dispatch router
class certs::qpid_router::client (
$hostname = $certs::node_fqdn,
$cname = $certs::cname,
$generate = $certs::generate,
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,
$cert = $certs::qpid_router_client_cert,
$key = $certs::qpid_router_client_key,
$owner = 'qdrouterd',
$group = 'root',
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$org_unit = $certs::org_unit,
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,
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 $cert = $certs::qpid_router_client_cert,
Stdlib::Absolutepath $key = $certs::qpid_router_client_key,
String $owner = 'qdrouterd',
String $group = 'root',
String[2,2] $country = $certs::country,
String $state = $certs::state,
String $city = $certs::city,
String $org_unit = $certs::org_unit,
String $expiration = $certs::expiration,
$default_ca = $certs::default_ca,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
) inherits certs {
$client_keypair = "${hostname}-qpid-router-client"
manifests/qpid_router/server.pp
# Constains certs specific configurations for qpid dispatch router
class certs::qpid_router::server (
$hostname = $certs::node_fqdn,
$cname = $certs::cname,
$generate = $certs::generate,
$regenerate = $certs::regenerate,
$deploy = $certs::deploy,
$cert = $certs::qpid_router_server_cert,
$key = $certs::qpid_router_server_key,
$owner = 'qdrouterd',
$group = 'root',
$country = $certs::country,
$state = $certs::state,
$city = $certs::city,
$org_unit = $certs::org_unit,
$expiration = $certs::expiration,
$default_ca = $certs::default_ca,
$ca_key_password_file = $certs::ca_key_password_file,
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 $cert = $certs::qpid_router_server_cert,
Stdlib::Absolutepath $key = $certs::qpid_router_server_key,
String $owner = 'qdrouterd',
String $group = 'root',
String[2,2] $country = $certs::country,
String $state = $certs::state,
String $city = $certs::city,
String $org_unit = $certs::org_unit,
String $expiration = $certs::expiration,
$default_ca = $certs::default_ca,
Stdlib::Absolutepath $ca_key_password_file = $certs::ca_key_password_file,
) inherits certs {
$server_keypair = "${hostname}-qpid-router-server"
manifests/ssltools/certutil.pp
# type to append cert to nssdb
define certs::ssltools::certutil($nss_db_dir, $client_cert, $cert_name=$title, $refreshonly = true, $trustargs = ',,') {
define certs::ssltools::certutil(
Stdlib::Absolutepath $nss_db_dir,
Stdlib::Absoluatepath $client_cert,
String $cert_name = $title,
Boolean $refreshonly = true,
Boolean $trustargs = ',,',
) {
include certs::ssltools::nssdb
# lint:ignore:relative_classname_reference
manifests/tar_create.pp
# $foreman_proxy_fqdn:: FQDN of the foreman proxy
#
define certs::tar_create(
$path = $title,
$foreman_proxy_fqdn = $certs::foreman_proxy_content::foreman_proxy_fqdn,
Stdlib::Absolutepath $path = $title,
Stdlib::Fqdn $foreman_proxy_fqdn = $certs::foreman_proxy_content::foreman_proxy_fqdn,
) {
$ca_rpms = 'ssl-build/*.noarch.rpm'
manifests/tar_extract.pp
# Actions:
# - Extracts a tarball
#
define certs::tar_extract($path = $title) {
define certs::tar_extract(
Stdlib::Absolutepath $path = $title,
) {
validate_file_exists($path)
exec { "extract ${path}":

Also available in: Unified diff