Skip to content

Commit fb40923

Browse files
authored
Merge pull request puppetlabs#356 from caseywilliams/MODULES-8317/upgrade-deps
(MODULES-8317) Update module dependencies
2 parents eece6ae + 8a355c5 commit fb40923

8 files changed

+19
-324
lines changed

.fixtures.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ fixtures:
22
forge_modules:
33
stdlib:
44
repo: "puppetlabs/stdlib"
5-
ref: "4.16.0"
6-
transition:
7-
repo: "puppetlabs/transition"
5+
ref: "5.1.0"
86
inifile:
97
repo: "puppetlabs/inifile"
10-
ref: "2.1.0"
8+
ref: "2.4.0"
119
apt:
1210
repo: "puppetlabs/apt"
13-
ref: "4.4.0"
11+
ref: "6.0.0"
1412
yumrepo_core:
1513
repo: "puppetlabs/yumrepo_core"
1614
symlinks:

manifests/install.pp

+8-69
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
) {
1919
assert_private()
2020

21-
$old_packages = (versioncmp("${::clientversion}", '4.0.0') < 0)
2221
$pa_collection = getvar('::puppet_agent::collection')
2322

2423
if ($::operatingsystem == 'SLES' and $::operatingsystemmajrelease == '10') or $::operatingsystem == 'AIX' {
@@ -27,63 +26,29 @@
2726
default => $install_options
2827
}
2928

30-
if $old_packages {
31-
contain puppet_agent::install::remove_packages
32-
33-
exec { 'replace puppet.conf removed by package removal':
34-
path => '/bin:/usr/bin:/sbin:/usr/sbin',
35-
command => "cp ${puppet_agent::params::confdir}/puppet.conf.rpmsave ${puppet_agent::params::config}",
36-
creates => $puppet_agent::params::config,
37-
require => Class['puppet_agent::install::remove_packages'],
38-
before => Package[$puppet_agent::package_name],
39-
logoutput => 'on_failure',
40-
}
41-
42-
# package provider does not provide 'versionable'
43-
$ensure = 'present'
44-
} else {
45-
$ensure = $package_version
46-
}
4729

4830
package { $::puppet_agent::package_name:
49-
ensure => $ensure,
31+
ensure => $package_version,
5032
provider => 'rpm',
5133
source => "/opt/puppetlabs/packages/${package_file_name}",
5234
install_options => $_install_options,
5335
}
5436
} elsif $::operatingsystem == 'Solaris' and $::operatingsystemmajrelease == '10' {
5537
$_unzipped_package_name = regsubst($package_file_name, '\.gz$', '')
38+
$install_script = 'solaris_install.sh.erb'
39+
40+
# The following are expected to be available in the solaris_install.sh.erb template:
5641
$adminfile = '/opt/puppetlabs/packages/solaris-noask'
5742
$sourcefile = "/opt/puppetlabs/packages/${_unzipped_package_name}"
58-
$install_script = 'solaris_install.sh.erb'
5943

6044
# Puppet prior to 5.0 would not use a separate process contract when forking from the Puppet
6145
# service. That resulted in service-initiated upgrades failing because trying to remove or
6246
# upgrade the package would stop the service, thereby killing the Puppet run. Use a script
6347
# to perform the upgrade after Puppet is done running.
6448
# Puppet 5.0 adds this, but some i18n implementation is loading code fairly late and appears
6549
# to be messing up the upgrade.
66-
if $old_packages or $puppet_agent::aio_upgrade_required {
67-
$old_package_names = $old_packages ? {
68-
true => [
69-
'PUPpuppet',
70-
'PUPaugeas',
71-
'PUPdeep-merge',
72-
'PUPfacter',
73-
'PUPhiera',
74-
'PUPlibyaml',
75-
'PUPmcollective',
76-
'PUPopenssl',
77-
'PUPpuppet-enterprise-release',
78-
'PUPruby',
79-
'PUPruby-augeas',
80-
'PUPruby-rgen',
81-
'PUPruby-shadow',
82-
'PUPstomp',
83-
],
84-
default => ['puppet-agent'],
85-
}
8650

51+
if $puppet_agent::aio_upgrade_required {
8752
$_logfile = "${::env_temp_variable}/solaris_install.log"
8853
notice ("Puppet install log file at ${_logfile}")
8954

@@ -97,52 +62,26 @@
9762
command => "/usr/bin/ctrun -l none ${_installsh} ${::puppet_agent_pid} 2>&1 > ${_logfile} &",
9863
}
9964
}
100-
} elsif $::operatingsystem == 'Solaris' and $::operatingsystemmajrelease == '11' and $old_packages {
101-
# Updating from PE 3.x requires removing all the old packages before installing the puppet-agent package.
102-
# After puppet-agent is installed, we can use 'pkg update' for future upgrades.
103-
contain puppet_agent::install::remove_packages
104-
105-
exec { 'puppet_agent restore /etc/puppetlabs':
106-
command => 'cp -r /tmp/puppet_agent/puppetlabs /etc',
107-
path => '/bin:/usr/bin:/sbin:/usr/sbin',
108-
require => Class['puppet_agent::install::remove_packages'],
109-
}
110-
111-
package { $::puppet_agent::package_name:
112-
ensure => 'present',
113-
require => Exec['puppet_agent restore /etc/puppetlabs'],
114-
notify => Exec['puppet_agent post-install restore /etc/puppetlabs'],
115-
install_options => $install_options,
116-
}
117-
118-
exec { 'puppet_agent post-install restore /etc/puppetlabs':
119-
command => 'cp -r /tmp/puppet_agent/puppetlabs /etc',
120-
path => '/bin:/usr/bin:/sbin:/usr/sbin',
121-
refreshonly => true,
122-
}
12365
} elsif $::operatingsystem == 'Darwin' and $::macosx_productversion_major =~ /^10\.(9|10|11|12|13)/ {
124-
if $old_packages or $puppet_agent::aio_upgrade_required {
66+
if $puppet_agent::aio_upgrade_required {
12567
$install_script = 'osx_install.sh.erb'
12668

127-
contain puppet_agent::install::remove_packages
128-
12969
$_logfile = "${::env_temp_variable}/osx_install.log"
13070
notice("Puppet install log file at ${_logfile}")
13171

13272
$_installsh = "${::env_temp_variable}/osx_install.sh"
13373
file { "${_installsh}":
13474
ensure => file,
13575
mode => '0755',
136-
content => template('puppet_agent/do_install.sh.erb'),
137-
require => Class['Puppet_agent::Install::Remove_packages']
76+
content => template('puppet_agent/do_install.sh.erb')
13877
}
13978
-> exec { 'osx_install script':
14079
command => "${_installsh} ${::puppet_agent_pid} 2>&1 > ${_logfile} &",
14180
}
14281
}
14382
} elsif $::osfamily == 'windows' {
14483
# Prevent re-running the batch install
145-
if $old_packages or $puppet_agent::aio_upgrade_required {
84+
if $puppet_agent::aio_upgrade_required {
14685
if $::puppet_agent::is_pe == true and empty($::puppet_agent::source) {
14786
$local_package_file_path = windows_native_path("${::puppet_agent::params::local_packages_dir}/${package_file_name}")
14887
class { 'puppet_agent::windows::install':

manifests/install/remove_packages.pp

-169
This file was deleted.

manifests/install/remove_packages_osx.pp

-62
This file was deleted.

metadata.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,8 @@
131131
}
132132
],
133133
"dependencies": [
134-
{"name":"puppetlabs-stdlib","version_requirement":">= 4.16.0 < 5.0.0"},
135-
{"name":"puppetlabs-transition","version_requirement":">= 0.1.1 < 0.2.0"},
136-
{"name":"puppetlabs-inifile","version_requirement":">= 1.2.0 <= 2.1.0"},
137-
{"name":"puppetlabs-apt","version_requirement":">= 4.4.0 < 5.0.0"}
134+
{"name":"puppetlabs-stdlib","version_requirement":">= 5.1.0 < 6.0.0"},
135+
{"name":"puppetlabs-inifile","version_requirement":">= 2.4.0 <= 3.0.0"},
136+
{"name":"puppetlabs-apt","version_requirement":">= 6.0.0 < 7.0.0"}
138137
]
139138
}

0 commit comments

Comments
 (0)