Skip to content

Commit cf7a787

Browse files
committed
Remove insecure pe_installer_source parameter
1 parent e5f627c commit cf7a787

File tree

4 files changed

+7
-63
lines changed

4 files changed

+7
-63
lines changed

REFERENCE.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2042,7 +2042,6 @@ The following parameters are available in the `peadm::install` plan:
20422042
* [`compiler_pool_address`](#-peadm--install--compiler_pool_address)
20432043
* [`internal_compiler_a_pool_address`](#-peadm--install--internal_compiler_a_pool_address)
20442044
* [`internal_compiler_b_pool_address`](#-peadm--install--internal_compiler_b_pool_address)
2045-
* [`pe_installer_source`](#-peadm--install--pe_installer_source)
20462045
* [`ldap_config`](#-peadm--install--ldap_config)
20472046
* [`final_agent_state`](#-peadm--install--final_agent_state)
20482047
* [`stagingdir`](#-peadm--install--stagingdir)
@@ -2098,17 +2097,6 @@ architectures.
20982097

20992098
Default value: `undef`
21002099

2101-
##### <a name="-peadm--install--pe_installer_source"></a>`pe_installer_source`
2102-
2103-
Data type: `Optional[Stdlib::HTTPSUrl]`
2104-
2105-
The URL to download the Puppet Enterprise installer media from. If not
2106-
specified, PEAdm will attempt to download PE installation media from its
2107-
standard public source. When specified, PEAdm will download directly from the
2108-
URL given.
2109-
2110-
Default value: `undef`
2111-
21122100
##### <a name="-peadm--install--ldap_config"></a>`ldap_config`
21132101

21142102
Data type: `Optional[Peadm::Ldap_config]`
@@ -2567,7 +2555,6 @@ The following parameters are available in the `peadm::upgrade` plan:
25672555
* [`compiler_pool_address`](#-peadm--upgrade--compiler_pool_address)
25682556
* [`internal_compiler_a_pool_address`](#-peadm--upgrade--internal_compiler_a_pool_address)
25692557
* [`internal_compiler_b_pool_address`](#-peadm--upgrade--internal_compiler_b_pool_address)
2570-
* [`pe_installer_source`](#-peadm--upgrade--pe_installer_source)
25712558
* [`final_agent_state`](#-peadm--upgrade--final_agent_state)
25722559
* [`r10k_known_hosts`](#-peadm--upgrade--r10k_known_hosts)
25732560
* [`stagingdir`](#-peadm--upgrade--stagingdir)
@@ -2612,17 +2599,6 @@ architectures.
26122599

26132600
Default value: `undef`
26142601

2615-
##### <a name="-peadm--upgrade--pe_installer_source"></a>`pe_installer_source`
2616-
2617-
Data type: `Optional[Stdlib::HTTPSUrl]`
2618-
2619-
The URL to download the Puppet Enterprise installer media from. If not
2620-
specified, PEAdm will attempt to download PE installation media from its
2621-
standard public source. When specified, PEAdm will download directly from the
2622-
URL given.
2623-
2624-
Default value: `undef`
2625-
26262602
##### <a name="-peadm--upgrade--final_agent_state"></a>`final_agent_state`
26272603

26282604
Data type: `Enum['running', 'stopped']`

plans/install.pp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
# A load balancer address directing traffic to any of the "B" pool
1212
# compilers. This is used for DR configuration in large and extra large
1313
# architectures.
14-
# @param pe_installer_source
15-
# The URL to download the Puppet Enterprise installer media from. If not
16-
# specified, PEAdm will attempt to download PE installation media from its
17-
# standard public source. When specified, PEAdm will download directly from the
18-
# URL given.
1914
# @param ldap_config
2015
# If specified, configures PE RBAC DS with the supplied configuration hash.
2116
# The parameter should be set to a valid set of connection settings as
@@ -47,7 +42,6 @@
4742
# Common Configuration
4843
String $console_password,
4944
Peadm::Pe_version $version = '2023.8.1',
50-
Optional[Stdlib::HTTPSUrl] $pe_installer_source = undef,
5145
Optional[Array[String]] $dns_alt_names = undef,
5246
Optional[String] $compiler_pool_address = undef,
5347
Optional[String] $internal_compiler_a_pool_address = undef,
@@ -94,7 +88,6 @@
9488

9589
# Common Configuration
9690
version => $version,
97-
pe_installer_source => $pe_installer_source,
9891
console_password => $console_password,
9992
dns_alt_names => $dns_alt_names,
10093
pe_conf_data => $pe_conf_data,

plans/subplans/install.pp

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,6 @@
2828
# Config data to plane into pe.conf when generated on all hosts, this can be
2929
# used for tuning data etc.
3030
#
31-
# @param pe_installer_source
32-
# The URL to download the Puppet Enterprise installer media from. If not
33-
# specified, PEAdm will attempt to download PE installation media from its
34-
# standard public source. When specified, PEAdm will download directly from the
35-
# URL given.
36-
#
3731
plan peadm::subplans::install (
3832
# Standard
3933
Peadm::SingleTargetSpec $primary_host,
@@ -50,7 +44,6 @@
5044
# Common Configuration
5145
String $console_password,
5246
Peadm::Pe_version $version,
53-
Optional[Stdlib::HTTPSUrl] $pe_installer_source = undef,
5447
Array[String] $dns_alt_names = [],
5548
Hash $pe_conf_data = {},
5649

@@ -237,13 +230,8 @@
237230
)
238231
}
239232

240-
if $pe_installer_source {
241-
$pe_tarball_name = $pe_installer_source.split('/')[-1]
242-
$pe_tarball_source = $pe_installer_source
243-
} else {
244-
$pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz"
245-
$pe_tarball_source = "https://s3.amazonaws.com/pe-builds/released/${version}/${pe_tarball_name}"
246-
}
233+
$pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz"
234+
$pe_tarball_source = "https://s3.amazonaws.com/pe-builds/released/${version}/${pe_tarball_name}"
247235

248236
$upload_tarball_path = "${uploaddir}/${pe_tarball_name}"
249237

plans/upgrade.pp

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@
1111
# A load balancer address directing traffic to any of the "B" pool
1212
# compilers. This is used for DR configuration in large and extra large
1313
# architectures.
14-
# @param pe_installer_source
15-
# The URL to download the Puppet Enterprise installer media from. If not
16-
# specified, PEAdm will attempt to download PE installation media from its
17-
# standard public source. When specified, PEAdm will download directly from the
18-
# URL given.
1914
# @param final_agent_state
2015
# Configures the state the puppet agent should be in on infrastructure nodes
2116
# after PE is upgraded successfully.
@@ -46,7 +41,6 @@
4641

4742
# Common Configuration
4843
Optional[Peadm::Pe_version] $version = undef,
49-
Optional[Stdlib::HTTPSUrl] $pe_installer_source = undef,
5044
Optional[String] $compiler_pool_address = undef,
5145
Optional[String] $internal_compiler_a_pool_address = undef,
5246
Optional[String] $internal_compiler_b_pool_address = undef,
@@ -119,21 +113,14 @@
119113

120114
$platform = run_task('peadm::precheck', $primary_target).first['platform']
121115

122-
if $pe_installer_source {
123-
$pe_tarball_name = $pe_installer_source.split('/')[-1]
124-
$pe_tarball_source = $pe_installer_source
125-
$_version = $pe_tarball_name.split('-')[2]
126-
} else {
127-
$_version = $version
128-
$pe_tarball_name = "puppet-enterprise-${_version}-${platform}.tar.gz"
129-
$pe_tarball_source = "https://s3.amazonaws.com/pe-builds/released/${_version}/${pe_tarball_name}"
130-
}
116+
$pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz"
117+
$pe_tarball_source = "https://s3.amazonaws.com/pe-builds/released/${version}/${pe_tarball_name}"
131118

132119
$upload_tarball_path = "${uploaddir}/${pe_tarball_name}"
133120

134121
peadm::assert_supported_bolt_version()
135122

136-
peadm::assert_supported_pe_version($_version, $permit_unsafe_versions)
123+
peadm::assert_supported_pe_version($version, $permit_unsafe_versions)
137124

138125
# Gather certificate extension information from all systems
139126
$cert_extensions_temp = run_task('peadm::cert_data', $all_targets).reduce({}) |$memo,$result| {
@@ -402,7 +389,7 @@
402389
# doesn't deal well with the PuppetDB database being on a separate node.
403390
# So, move it aside before running the upgrade.
404391
$pdbapps = '/opt/puppetlabs/server/apps/puppetdb/cli/apps'
405-
$workaround_delete_reports = $arch['disaster-recovery'] and $_version =~ SemVerRange('>= 2019.8')
392+
$workaround_delete_reports = $arch['disaster-recovery'] and $version =~ SemVerRange('>= 2019.8')
406393
if $workaround_delete_reports {
407394
# lint:ignore:strict_indent
408395
run_command(@("COMMAND"/$), $replica_target)
@@ -454,7 +441,7 @@
454441
)
455442
}
456443
457-
peadm::check_version_and_known_hosts($current_pe_version, $_version, $r10k_known_hosts)
444+
peadm::check_version_and_known_hosts($current_pe_version, $version, $r10k_known_hosts)
458445
459446
return("Upgrade of Puppet Enterprise ${arch['architecture']} completed.")
460447
}

0 commit comments

Comments
 (0)