Skip to content

Add optional pe_installer_source parameter #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions plans/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
# A load balancer address directing traffic to any of the "B" pool
# compilers. This is used for DR configuration in large and extra large
# architectures.
# @param pe_installer_source
# The URL to download the Puppet Enterprise installer media from. If not
# specified, PEAdm will attempt to download PE installation media from its
# standard public source. When specified, PEAdm will download directly from the
# URL given.
#
plan peadm::install (
# Standard
Expand All @@ -27,6 +32,7 @@
# Common Configuration
String $console_password,
Peadm::Pe_version $version = '2019.8.8',
Optional[String] $pe_installer_source = undef,
Optional[Array[String]] $dns_alt_names = undef,
Optional[String] $compiler_pool_address = undef,
Optional[String] $internal_compiler_a_pool_address = undef,
Expand Down Expand Up @@ -66,6 +72,7 @@

# Common Configuration
version => $version,
pe_installer_source => $pe_installer_source,
console_password => $console_password,
dns_alt_names => $dns_alt_names,
pe_conf_data => $pe_conf_data,
Expand Down
16 changes: 13 additions & 3 deletions plans/subplans/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@
# Config data to plane into pe.conf when generated on all hosts, this can be
# used for tuning data etc.
#
# @param pe_installer_source
# The URL to download the Puppet Enterprise installer media from. If not
# specified, PEAdm will attempt to download PE installation media from its
# standard public source. When specified, PEAdm will download directly from the
# URL given.
#
plan peadm::subplans::install (
# Standard
Peadm::SingleTargetSpec $primary_host,
Expand All @@ -35,8 +41,9 @@
# Common Configuration
String $console_password,
Peadm::Pe_version $version,
Array[String] $dns_alt_names = [ ],
Hash $pe_conf_data = { },
Optional[String] $pe_installer_source = undef,
Array[String] $dns_alt_names = [ ],
Hash $pe_conf_data = { },

# Code Manager
Optional[String] $r10k_remote = undef,
Expand Down Expand Up @@ -191,7 +198,10 @@
}

$pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz"
$pe_tarball_source = "https://s3.amazonaws.com/pe-builds/released/${version}/${pe_tarball_name}"
$pe_tarball_source = $pe_installer_source ? {
undef => "https://s3.amazonaws.com/pe-builds/released/${version}/${pe_tarball_name}",
default => $pe_installer_source,
}
$upload_tarball_path = "/tmp/${pe_tarball_name}"

if $download_mode == 'bolthost' {
Expand Down
11 changes: 10 additions & 1 deletion plans/upgrade.pp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
# A load balancer address directing traffic to any of the "B" pool
# compilers. This is used for DR configuration in large and extra large
# architectures.
# @param pe_installer_source
# The URL to download the Puppet Enterprise installer media from. If not
# specified, PEAdm will attempt to download PE installation media from its
# standard public source. When specified, PEAdm will download directly from the
# URL given.
#
plan peadm::upgrade (
# Standard
Expand All @@ -26,6 +31,7 @@

# Common Configuration
Peadm::Pe_version $version,
Optional[String] $pe_installer_source = undef,
Optional[String] $compiler_pool_address = undef,
Optional[String] $internal_compiler_a_pool_address = undef,
Optional[String] $internal_compiler_b_pool_address = undef,
Expand Down Expand Up @@ -121,7 +127,10 @@

$platform = run_task('peadm::precheck', $primary_target).first['platform']
$tarball_filename = "puppet-enterprise-${version}-${platform}.tar.gz"
$tarball_source = "https://s3.amazonaws.com/pe-builds/released/${version}/${tarball_filename}"
$tarball_source = $pe_installer_source ? {
undef => "https://s3.amazonaws.com/pe-builds/released/${version}/${tarball_filename}",
default => $pe_installer_source,
}
$upload_tarball_path = "/tmp/${tarball_filename}"

peadm::plan_step('preparation') || {
Expand Down