diff --git a/REFERENCE.md b/REFERENCE.md index 984ead86..3de99282 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -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` @@ -2324,7 +2325,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` diff --git a/plans/install.pp b/plans/install.pp index cd75f13f..b5c89988 100644 --- a/plans/install.pp +++ b/plans/install.pp @@ -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 diff --git a/plans/subplans/install.pp b/plans/subplans/install.pp index 0ecbd6bf..a8d444a8 100644 --- a/plans/subplans/install.pp +++ b/plans/subplans/install.pp @@ -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 @@ -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}" diff --git a/plans/upgrade.pp b/plans/upgrade.pp index f1b340b7..5a26311d 100644 --- a/plans/upgrade.pp +++ b/plans/upgrade.pp @@ -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 final_agent_state # Configures the state the puppet agent should be in on infrastructure nodes # after PE is upgraded successfully. @@ -118,9 +119,15 @@ $platform = run_task('peadm::precheck', $primary_target).first['platform'] if $pe_installer_source { - $pe_tarball_name = $pe_installer_source.split('/')[-1] - $pe_tarball_source = $pe_installer_source - $_version = $pe_tarball_name.split('-')[2] + if $pe_installer_source[-1] == '/' { + $_version = $version + $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 + $_version = $pe_tarball_name.split('-')[2] + } } else { $_version = $version $pe_tarball_name = "puppet-enterprise-${_version}-${platform}.tar.gz"