diff --git a/.sync.yml b/.sync.yml index c16af784..0b5529c5 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,5 +1,5 @@ --- Rakefile: param_docs_pattern: - - manifests/capsule.pp + - manifests/foreman_proxy_content.pp - manifests/init.pp diff --git a/Rakefile b/Rakefile index aa15a3c0..8a2fd2eb 100644 --- a/Rakefile +++ b/Rakefile @@ -21,7 +21,7 @@ PuppetLint.configuration.log_format = '%{path}:%{linenumber}:%{KIND}: %{message} require 'puppet-lint-param-docs/tasks' PuppetLintParamDocs.define_selective do |config| - config.pattern = ["manifests/capsule.pp", "manifests/init.pp"] + config.pattern = ["manifests/foreman_proxy_content.pp", "manifests/init.pp"] end task :default => [:validate, :lint, :spec] diff --git a/manifests/capsule.pp b/manifests/capsule.pp deleted file mode 100644 index 9fd78f67..00000000 --- a/manifests/capsule.pp +++ /dev/null @@ -1,42 +0,0 @@ -# Prepare the certificates for the node from the parent node -# -# === Parameters: -# -# $parent_fqdn:: fqdn of the parent node. Does not usually -# need to be set. -# -# $capsule_fqdn:: fqdn of the capsule. REQUIRED -# -# $certs_tar:: path to tar file with certs to generate. REQUIRED -# -class certs::capsule ( - $parent_fqdn = $fqdn, - $capsule_fqdn = $certs::node_fqdn, - $certs_tar = $certs::params::certs_tar - ) inherits certs::params { - - # until we support again pushing the cert rpms to the Katello, - # make sure the certs_tar path is present - validate_present($certs_tar) - validate_present($capsule_fqdn) - - class { '::certs::puppet': hostname => $capsule_fqdn } - class { '::certs::foreman': hostname => $capsule_fqdn } - class { '::certs::foreman_proxy': hostname => $capsule_fqdn } - class { '::certs::apache': hostname => $capsule_fqdn } - class { '::certs::qpid': hostname => $capsule_fqdn } - class { '::certs::qpid_router': hostname => $capsule_fqdn } - class { '::certs::qpid_client': hostname => $capsule_fqdn } - - if $certs_tar { - certs::tar_create { $certs_tar: - subscribe => [Class['certs::puppet'], - Class['certs::foreman'], - Class['certs::foreman_proxy'], - Class['certs::qpid'], - Class['certs::qpid_router'], - Class['certs::apache'], - Class['certs::qpid_client']], - } - } -} diff --git a/manifests/foreman_proxy_content.pp b/manifests/foreman_proxy_content.pp new file mode 100644 index 00000000..3b8564ff --- /dev/null +++ b/manifests/foreman_proxy_content.pp @@ -0,0 +1,42 @@ +# Prepare the certificates for the node from the parent node +# +# === Parameters: +# +# $parent_fqdn:: fqdn of the parent node. Does not usually +# need to be set. +# +# $foreman_proxy_fqdn:: fqdn of the foreman proxy. REQUIRED +# +# $certs_tar:: path to tar file with certs to generate. REQUIRED +# +class certs::foreman_proxy_content ( + $parent_fqdn = $fqdn, + $foreman_proxy_fqdn = $certs::node_fqdn, + $certs_tar = $certs::params::certs_tar + ) inherits certs::params { + + # until we support again pushing the cert rpms to the Katello, + # make sure the certs_tar path is present + validate_present($certs_tar) + validate_present($foreman_proxy_fqdn) + + class { '::certs::puppet': hostname => $foreman_proxy_fqdn } + class { '::certs::foreman': hostname => $foreman_proxy_fqdn } + class { '::certs::foreman_proxy': hostname => $foreman_proxy_fqdn } + class { '::certs::apache': hostname => $foreman_proxy_fqdn } + class { '::certs::qpid': hostname => $foreman_proxy_fqdn } + class { '::certs::qpid_router': hostname => $foreman_proxy_fqdn } + class { '::certs::qpid_client': hostname => $foreman_proxy_fqdn } + + if $certs_tar { + certs::tar_create { $certs_tar: + subscribe => [Class['certs::puppet'], + Class['certs::foreman'], + Class['certs::foreman_proxy'], + Class['certs::qpid'], + Class['certs::qpid_router'], + Class['certs::apache'], + Class['certs::qpid_client']], + } + } +} diff --git a/manifests/tar_create.pp b/manifests/tar_create.pp index 46f5607f..d62d687d 100644 --- a/manifests/tar_create.pp +++ b/manifests/tar_create.pp @@ -1,21 +1,21 @@ -# Definition: certs::tar_create +# Define: certs::tar_create # -# This class creates a tar ball of generated SSL certs +# This define creates a tar ball of generated SSL certs # -# Parameters: -# - The $path of files to tar up -# - The $capsule_fqdn +# === Parameters # -# Actions: -# - Create a tarball of SSL certs +# $path:: The $path of files to tar # -# Requires: -# - The certs class +# $foreman_proxy_fqdn:: FQDN of the foreman proxy # -define certs::tar_create($path = $title, $capsule_fqdn = $::certs::capsule::capsule_fqdn) { - exec { "generate ${path}": - cwd => '/root', - path => ['/usr/bin', '/bin'], - command => "tar -czf ${path} ssl-build/*.noarch.rpm ssl-build/${capsule_fqdn}/*.noarch.rpm", - } +define certs::tar_create( + $path = $title, + $foreman_proxy_content_fqdn = $::certs::foreman_proxy_content::foreman_proxy_fqdn, +) { + + exec { "generate ${path}": + cwd => '/root', + path => ['/usr/bin', '/bin'], + command => "tar -czf ${path} ssl-build/*.noarch.rpm ssl-build/${foreman_proxy_fqdn}/*.noarch.rpm", + } }