Skip to content

Commit

Permalink
(maint) Update source calculation to prefer $::puppet_agent::source
Browse files Browse the repository at this point in the history
If the user specifies the source parameter to the overall puppet_agent module
then we should prefer that setting to anything calculated in the osfamily
classes.

This commit updates those classes to prefer $::puppet_agent::source if it's
available.
  • Loading branch information
Sean P. McDonald committed Mar 5, 2019
1 parent ad90383 commit 2f0cc19
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 10 deletions.
6 changes: 5 additions & 1 deletion manifests/osfamily/aix.pp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@
$aix_ver_number = '6.1'
}
}
$source = "puppet:///pe_packages/${pe_server_version}/aix-${aix_ver_number}-power/${::puppet_agent::package_name}-${::puppet_agent::package_version}-1.aix${aix_ver_number}.ppc.rpm"
if $::puppet_agent::source {
$source = $::puppet_agent::source
} else {
$source = "puppet:///pe_packages/${pe_server_version}/aix-${aix_ver_number}-power/${::puppet_agent::package_name}-${::puppet_agent::package_version}-1.aix${aix_ver_number}.ppc.rpm"
}

class { '::puppet_agent::prepare::package':
source => $source,
Expand Down
4 changes: 3 additions & 1 deletion manifests/osfamily/darwin.pp
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
class puppet_agent::osfamily::darwin{
assert_private()

if $::puppet_agent::is_pe {
if $::puppet_agent::source {
$source = $::puppet_agent::source
} elsif $::puppet_agent::is_pe {
$pe_server_version = pe_build_version()
$source = "puppet:///pe_packages/${pe_server_version}/${::platform_tag}/${puppet_agent::package_name}-${puppet_agent::package_version}-1.osx${$::macosx_productversion_major}.dmg"
} else {
Expand Down
12 changes: 10 additions & 2 deletions manifests/osfamily/debian.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@

if getvar('::puppet_agent::is_pe') == true {
$pe_server_version = pe_build_version()
$source = "https://${::servername}:8140/packages/${pe_server_version}/${::platform_tag}"
if $::puppet_agent::source {
$source = $::puppet_agent::source
} else {
$source = "https://${::servername}:8140/packages/${pe_server_version}/${::platform_tag}"
}
# In Puppet Enterprise, agent packages are served by the same server
# as the master, which can be using either a self signed CA, or an external CA.
# In order for apt to authenticate to the repo on the PE Master, it will need
Expand Down Expand Up @@ -55,7 +59,11 @@
content => '',
}
} else {
$source = 'https://apt.puppet.com'
if $::puppet_agent::source {
$source = $::puppet_agent::source
} else {
$source = 'https://apt.puppet.com'
}
}

$legacy_keyname = 'GPG-KEY-puppetlabs'
Expand Down
12 changes: 10 additions & 2 deletions manifests/osfamily/redhat.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@
true => "el-6-${::architecture}",
default => $::platform_tag,
}
$source = "https://${::servername}:8140/packages/${pe_server_version}/${pe_repo_dir}"
if $::puppet_agent::source {
$source = $::puppet_agent::source
} else {
$source = "https://${::servername}:8140/packages/${pe_server_version}/${pe_repo_dir}"
}
# In Puppet Enterprise, agent packages are served by the same server
# as the master, which can be using either a self signed CA, or an external CA.
# In order for yum to authenticate to the yumrepo on the PE Master, it will need
Expand Down Expand Up @@ -39,7 +43,11 @@
$platform_and_version = "el/${::operatingsystemmajrelease}"
}
}
$source = "http://yum.puppet.com/${::puppet_agent::collection}/${platform_and_version}/${::puppet_agent::arch}"
if $::puppet_agent::source {
$source = $::puppet_agent::source
} else {
$source = "http://yum.puppet.com/${::puppet_agent::collection}/${platform_and_version}/${::puppet_agent::arch}"
}
$_sslcacert_path = undef
$_sslclientcert_path = undef
$_sslclientkey_path = undef
Expand Down
12 changes: 10 additions & 2 deletions manifests/osfamily/solaris.pp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
case $::operatingsystemmajrelease {
'10': {
$package_file_name = "${::puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.${pkg_arch}.pkg.gz"
$source = "puppet:///pe_packages/${pe_server_version}/${::platform_tag}/${package_file_name}"
if $::puppet_agent::source {
$source = $::puppet_agent::source
} else {
$source = "puppet:///pe_packages/${pe_server_version}/${::platform_tag}/${package_file_name}"
}
class { '::puppet_agent::prepare::package':
source => $source,
}
Expand All @@ -44,7 +48,11 @@
'11': {
if $::puppet_agent::manage_repo {
$package_file_name = "${::puppet_agent::package_name}@${::puppet_agent::prepare::package_version},5.11-1.${pkg_arch}.p5p"
$source = "puppet:///pe_packages/${pe_server_version}/${::platform_tag}/${package_file_name}"
if $::puppet_agent::source {
$source = $::puppet_agent::source
} else {
$source = "puppet:///pe_packages/${pe_server_version}/${::platform_tag}/${package_file_name}"
}
class { '::puppet_agent::prepare::package':
source => $source,
}
Expand Down
4 changes: 3 additions & 1 deletion manifests/osfamily/suse.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
fail("${::operatingsystem} not supported")
}

if $::puppet_agent::is_pe {
if $::puppet_agent::source {
$source = $::puppet_agent::source
} elsif $::puppet_agent::is_pe {
$pe_server_version = pe_build_version()
$source = "https://${::servername}:8140/packages/${pe_server_version}/${::platform_tag}"
} else {
Expand Down
4 changes: 3 additions & 1 deletion manifests/osfamily/windows.pp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class puppet_agent::osfamily::windows{
assert_private()
if $::puppet_agent::is_pe {
if $::puppet_agent::source {
$source = $::puppet_agent::source
} elsif $::puppet_agent::is_pe {
$pe_server_version = pe_build_version()
$tag = $::puppet_agent::arch ? {
'x64' => 'windows-x86_64',
Expand Down

0 comments on commit 2f0cc19

Please sign in to comment.