Skip to content

Commit

Permalink
Make $pe_installer_source more flexible
Browse files Browse the repository at this point in the history
This makes the peadm::install plan more flexible. Previously the
variable $pe_installer_source could point to an absolute URL directly to
the desired .tar.gz. Now it can also point to a web directory. Then
peadm will calculate the .tar.gz name and fetch it from the web
directory.
  • Loading branch information
bastelfreak committed Jul 25, 2024
1 parent 4d54a13 commit 52b83ca
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,8 @@ Data type: `Optional[String]`
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.
URL given. Can be an URL, that ends with a /, to a web directory that
contains the original archives or an absolute URL to the .tar.gz archive.

Default value: `undef`

Expand Down
3 changes: 2 additions & 1 deletion plans/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
# 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.
# URL given. Can be an URL, that ends with a /, to a web directory that
# contains the original archives or an absolute URL to the .tar.gz archive.
# @param ldap_config
# If specified, configures PE RBAC DS with the supplied configuration hash.
# The parameter should be set to a valid set of connection settings as
Expand Down
12 changes: 9 additions & 3 deletions plans/subplans/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
# 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.
# URL given. Can be an URL, that ends with a /, to a web directory that
# contains the original archives or an absolute URL to the .tar.gz archive.
#
plan peadm::subplans::install (
# Standard
Expand Down Expand Up @@ -229,8 +230,13 @@
}

if $pe_installer_source {
$pe_tarball_name = $pe_installer_source.split('/')[-1]
$pe_tarball_source = $pe_installer_source
if $pe_installer_source[-1] == '/' {
$pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz"
$pe_tarball_source = "${pe_installer_source}${pe_tarball_name}"
} else {
$pe_tarball_name = $pe_installer_source.split('/')[-1]
$pe_tarball_source = $pe_installer_source
}
} else {
$pe_tarball_name = "puppet-enterprise-${version}-${platform}.tar.gz"
$pe_tarball_source = "https://s3.amazonaws.com/pe-builds/released/${version}/${pe_tarball_name}"
Expand Down

0 comments on commit 52b83ca

Please sign in to comment.