Skip to content

Commit 6582e10

Browse files
authored
Merge pull request #484 from scbjans/support_absolute_source_in_tasks
Add support for absolute_source in puppet_agent::install task
2 parents 95cef9e + c2b99f0 commit 6582e10

File tree

5 files changed

+24
-2
lines changed

5 files changed

+24
-2
lines changed

tasks/install.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
"description": "The Puppet collection to install from (defaults to puppet, which maps to the latest collection released)",
1010
"type": "Optional[Enum[puppet6, puppet7, puppet, puppet6-nightly, puppet7-nightly, puppet-nightly]]"
1111
},
12+
"absolute_source": {
13+
"description": "The absolute source location to find the Puppet agent package",
14+
"type": "Optional[String]"
15+
},
1216
"yum_source": {
1317
"description": "The source location to find yum repos (defaults to yum.puppet.com)",
1418
"type": "Optional[String]"

tasks/install_powershell.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"description": "The Puppet collection to install from (defaults to puppet, which maps to the latest collection released)",
1111
"type": "Optional[Enum[puppet6, puppet7, puppet, puppet6-nightly, puppet7-nightly, puppet-nightly]]"
1212
},
13+
"absolute_source": {
14+
"description": "The absolute source location to find the Puppet agent package",
15+
"type": "Optional[String]"
16+
},
1317
"yum_source": {
1418
"description": "The source location to find yum repos (defaults to yum.puppet.com)",
1519
"type": "Optional[String]"

tasks/install_powershell.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Param(
33
[String]$version,
44
[String]$collection = 'puppet',
5+
[String]$absolute_source,
56
[String]$windows_source = 'https://downloads.puppet.com',
67
[String]$install_options = 'REINSTALLMODE="amus"',
78
[Bool]$stop_service = $False,
@@ -99,7 +100,12 @@ if (($collection -like '*nightly*') -And -Not ($PSBoundParameters.ContainsKey('w
99100
$windows_source = 'https://nightlies.puppet.com/downloads'
100101
}
101102

102-
$msi_source = "$windows_source/windows/${collection}/${msi_name}"
103+
if ($absolute_source) {
104+
$msi_source = "$absolute_source"
105+
}
106+
else {
107+
$msi_source = "$windows_source/windows/${collection}/${msi_name}"
108+
}
103109

104110
$date_time_stamp = (Get-Date -format s) -replace ':', '-'
105111
$msi_dest = Join-Path ([System.IO.Path]::GetTempPath()) "puppet-agent-$arch.msi"

tasks/install_shell.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
"description": "The Puppet collection to install from (defaults to puppet, which maps to the latest collection released)",
1212
"type": "Optional[Enum[puppet6, puppet7, puppet, puppet6-nightly, puppet7-nightly, puppet-nightly]]"
1313
},
14+
"absolute_source": {
15+
"description": "The absolute source location to find the Puppet agent package",
16+
"type": "Optional[String]"
17+
},
1418
"yum_source": {
1519
"description": "The source location to find yum repos (defaults to yum.puppet.com)",
1620
"type": "Optional[String]"

tasks/install_shell.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ info "Downloading Puppet $version for ${platform}..."
584584
case $platform in
585585
"SLES")
586586
info "SLES platform! Lets get you an RPM..."
587-
587+
588588
if [[ $PT__noop != true ]]; then
589589
for key in "puppet" "puppet-20250406"; do
590590
gpg_key="${tmp_dir}/RPM-GPG-KEY-${key}"
@@ -688,6 +688,10 @@ case $platform in
688688
;;
689689
esac
690690

691+
if [[ -n "$PT_absolute_source" ]]; then
692+
download_url=$PT_absolute_source
693+
fi
694+
691695
if [[ $PT__noop != true ]]; then
692696
download_filename="${tmp_dir}/${filename}"
693697

0 commit comments

Comments
 (0)