Skip to content

Commit

Permalink
refs #17366 - change references from capsule to foreman_proxy_content
Browse files Browse the repository at this point in the history
  • Loading branch information
stbenjam committed Dec 14, 2016
1 parent 069c196 commit d6effa7
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .sync.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
Rakefile:
param_docs_pattern:
- manifests/capsule.pp
- manifests/foreman_proxy_content.pp
- manifests/init.pp
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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]
42 changes: 42 additions & 0 deletions manifests/foreman_proxy_content.pp
Original file line number Diff line number Diff line change
@@ -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']],
}
}
}
30 changes: 15 additions & 15 deletions manifests/tar_create.pp
Original file line number Diff line number Diff line change
@@ -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_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",
}
}

0 comments on commit d6effa7

Please sign in to comment.