Skip to content

Commit dfcc24a

Browse files
committed
(PA-5302) Remove puppet5 and MCollective
Puppet 5 has long been end-of-life and we no longer support it in this module. This commit removes support and reference for Puppet 5 and MCollective, a service that was last provided in Puppet 5.
1 parent 519e395 commit dfcc24a

23 files changed

+24
-710
lines changed

README.md

+13-15
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@
6464

6565
## Overview
6666

67-
A module for installing, running, upgrading, and managing the configuration of Puppet agents. Supports upgrading from Puppet 4 puppet-agent packages to later versions including Puppet 4, Puppet 5, and Puppet 6.
68-
69-
Previous releases of this module, now unsupported, upgraded agents from later versions of Puppet 3 to Puppet 4.
67+
A module for installing, running, upgrading, and managing the configuration of Puppet agents. Supports upgrading from Puppet 6 puppet-agent packages to later versions including Puppet 7 and Puppet 8.
7068

7169
## Module Description
7270

@@ -80,13 +78,13 @@ If a config parameter is provided, it will manage the defined agent configuratio
8078

8179
### What puppet_agent affects
8280

83-
* Puppet, Facter, Hiera, and MCollective (MCollective is no longer included in Puppet 6 installs).
81+
* Puppet, Facter, and Hiera.
8482
* Puppet's SSL directory and puppet.conf.
8583
* Removes deprecated settings from puppet.conf.
8684

8785
### Setup requirements
8886

89-
Your agents must be running a minimum version of Puppet 4. They should already be pointed at a master running Puppet Server 2.1 or greater, and thus successfully applying catalogs compiled with the Puppet 4 or newer language.
87+
Your agents must be running a minimum version of Puppet 6. They should already be pointed at a master running Puppet Server 6 or greater, and thus successfully applying catalogs compiled with the Puppet 6 or newer language.
9088

9189
### Beginning with puppet_agent
9290

@@ -96,13 +94,13 @@ Install the puppet_agent module with `puppet module install puppetlabs-puppet_ag
9694

9795
Add the class to agents you want to upgrade, specifying the desired puppet-agent version:
9896

99-
~~~puppet
97+
``` puppet
10098
class {'::puppet_agent':
101-
package_version => '1.4.0',
99+
package_version => '7.23.0',
102100
}
103-
~~~
101+
```
104102

105-
This will ensure the version `1.4.0` of the puppet-agent package is installed. For version `1.4.0` and later, it will also remove the deprecated `pluginsync` setting from `puppet.conf`, unless explicitly managed elsewhere.
103+
This will ensure the version `7.23.0` of the puppet-agent package is installed.
106104

107105
## Using alternate sources
108106

@@ -153,16 +151,16 @@ If you are using puppetlabs-pe_repo to serve packages, but want to provide a loc
153151

154152
##### `arch`
155153

156-
The architecture version you wish to install. Defaults to `$::facts['architecture']`.
154+
The architecture version you wish to install. Defaults to `$facts['os']['architecture']`.
157155
``` puppet
158156
arch => 'x86_64'
159157
```
160158

161159
##### `collection`
162160

163-
The Puppet Collection to track, should be one of `puppet5`, `puppet6` or `puppet7`. Puppet collections contain the latest agents included in the collection's series, so `puppet5` will pull in the most recent Puppet 5 release (for example: 5.5.10) as also will `puppet6` for Puppet 6 (for example: 6.3.0). **This parameter is required for installations not connected to Puppet Enterprise**
161+
The Puppet Collection to track, should be a supported collection (e.g. `puppet7` or `puppet8`). Puppet collections contain the latest agents included in the collection's series, so `puppet7` will pull in the most recent Puppet 5 release (for example: 7.23.0). **This parameter is required for installations not connected to Puppet Enterprise**
164162
``` puppet
165-
collection => 'puppet6'
163+
collection => 'puppet7'
166164
```
167165

168166
##### `is_pe`
@@ -185,7 +183,7 @@ and the native package providers will be used to query pre-configured repos on t
185183

186184
The package version to upgrade to. This must be explicitly specified.
187185
``` puppet
188-
package_version => '5.5.10'
186+
package_version => '7.23.0'
189187
```
190188
or
191189
``` puppet
@@ -221,14 +219,14 @@ Unix/MacOS
221219

222220
Windows
223221
``` puppet
224-
source => 'C:/packages/puppet-agent-6.0.0-x64.msi'
222+
source => 'C:/packages/puppet-agent-7.23.0-x64.msi'
225223
```
226224

227225
##### `absolute_source`
228226

229227
Absolute ("fully qualified") source path from which you wish to download the latest version of Puppet. No path structure or package name is assumed: the fully qualified path to the package itself must be provided.
230228
``` puppet
231-
absolute_source => 'C:/packages/puppet-agent-6.0.0-x64.msi'
229+
absolute_source => 'C:/packages/puppet-agent-7.23.0-x64.msi'
232230
```
233231

234232
##### `yum_source`

acceptance/helpers.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def remove_installed_agent(host)
376376
manifest_lines << "yumrepo { 'pc_repo': ensure => absent, notify => Package['puppet-agent'] }"
377377
end
378378

379-
manifest_lines << "file { ['/etc/puppet', '/etc/puppetlabs', '/etc/mcollective']: ensure => absent, force => true, backup => false }"
379+
manifest_lines << "file { ['/etc/puppet', '/etc/puppetlabs']: ensure => absent, force => true, backup => false }"
380380

381381
manifest_lines << if %r{^(osx|sles|solaris)}.match?(host['platform'])
382382
# The macOS pkgdmg, SLES zypper, and Solaris sun providers don't support 'purged':

files/install_puppet.ps1

+1-2
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ function Script:Reset-PuppetServices {
256256
$ErrorActionPreference = "Stop"
257257
$service_names=@(
258258
"puppet",
259-
"pxp-agent",
260-
"mcollective"
259+
"pxp-agent"
261260
)
262261
try {
263262
$state_dir = (puppet.bat config print statedir --environment production)

lib/facter/mco_config.rb

-41
This file was deleted.

lib/facter/settings.rb

-6
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,3 @@
6767
Puppet.settings['client_datadir']
6868
end
6969
end
70-
71-
Facter.add('mco_confdir') do
72-
setcode do
73-
File.expand_path(File.join(Puppet.settings['confdir'], '../../mcollective/etc'))
74-
end
75-
end

manifests/init.pp

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The package version to upgrade to. Explicitly specify the version to upgrade to,
2727
# or set to 'auto' to specify the version of the compiling master.
2828
# [service_names]
29-
# An array of services to start, normally `puppet` and `mcollective`.
29+
# An array of services to start, normally `puppet`.
3030
# None will be started if the array is empty.
3131
# [source]
3232
# **INCLUDED FOR COMPATIBILITY WITH MODULE VERSIONS 1.0/2.0. PREFER USE OF "absolute_source",

manifests/install/solaris.pp

+2-6
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,8 @@
1616
# The following are expected to be available in the solaris_install.sh.erb template:
1717
$adminfile = '/opt/puppetlabs/packages/solaris-noask'
1818
$sourcefile = "/opt/puppetlabs/packages/${_unzipped_package_name}"
19-
# Starting with puppet6 and up collections we no longer carry the mcollective service
20-
if $::puppet_agent::collection != 'PC1' and $::puppet_agent::collection != 'puppet5' {
21-
$service_names = delete($::puppet_agent::service_names, 'mcollective')
22-
} else {
23-
$service_names = $::puppet_agent::service_names
24-
}
19+
20+
$service_names = $::puppet_agent::service_names
2521

2622
# Puppet prior to 5.0 would not use a separate process contract when forking from the Puppet
2723
# service. That resulted in service-initiated upgrades failing because trying to remove or

manifests/params.pp

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
# Solaris 11 is a special case; it uses a custom script.
1010
$service_names = []
1111
} else {
12-
# Mcollective will be removed from this list in the service manifest if
13-
# the puppet version is >= 6.0.0
14-
$service_names = ['puppet', 'mcollective']
12+
$service_names = ['puppet']
1513
}
1614
if $facts['os']['family'] == 'windows' {
1715
$local_puppet_dir = windows_native_path("${::puppet_agent_appdata}/Puppetlabs")

manifests/service.pp

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,7 @@
66
class puppet_agent::service {
77
assert_private()
88

9-
# Starting with puppet6 and up collections we no longer carry the mcollective service
10-
if versioncmp("${::clientversion}", '6.0.0') >= 0 {
11-
$_service_names = delete($::puppet_agent::service_names, 'mcollective')
12-
} else {
13-
$_service_names = $::puppet_agent::service_names
14-
}
9+
$_service_names = $::puppet_agent::service_names
1510

1611
if $facts['os']['name'] == 'Solaris' and $facts['os']['release']['major'] == '10' and versioncmp("${::clientversion}", '5.0.0') < 0 {
1712
# Skip managing service, upgrade script will handle it.

spec/acceptance/class_spec.rb

-70
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,12 @@ class { 'puppet_agent': package_version => '5.5.21', collection => 'puppet5' }
2727
end
2828

2929
if %r{windows}i.match?(default['platform'])
30-
# MODULES-4244: MCollective not started after upgrade
31-
describe service('mcollective') do
32-
it { is_expected.not_to be_enabled }
33-
it { is_expected.not_to be_running }
34-
end
35-
3630
describe service('puppet') do
3731
# PUPPET_AGENT_STARTUP_MODE=Manual
3832
it { is_expected.not_to be_enabled }
3933
it { is_expected.not_to be_running }
4034
end
4135
else
42-
describe service('mcollective') do
43-
it { is_expected.to be_enabled }
44-
it { is_expected.to be_running }
45-
end
46-
4736
describe service('puppet') do
4837
it { is_expected.to be_enabled }
4938
it { is_expected.to be_running }
@@ -127,68 +116,9 @@ class { 'puppet_agent': service_names => [] }
127116
describe service('puppet') do
128117
it { is_expected.not_to be_running }
129118
end
130-
131-
describe service('mcollective') do
132-
it { is_expected.not_to be_running }
133-
end
134119
end
135120

136121
unless %r{windows}i.match?(default['platform'])
137-
# MODULES-4244: MCollective not started after upgrade
138-
context 'with mcollective configured' do
139-
before(:all) do
140-
setup_puppet_on default, mcollective: true, agent: true
141-
manifest = 'class { "puppet_agent": package_version => "5.5.21", collection => "puppet5", service_names => ["mcollective"] }'
142-
pp = "file { '#{master.puppet['codedir']}/environments/production/manifests/site.pp': ensure => file, content => '#{manifest}' }"
143-
apply_manifest_on(master, pp, catch_failures: true)
144-
end
145-
after(:all) do
146-
pp = "file { '#{master.puppet['codedir']}/environments/production/manifests/site.pp': ensure => absent }"
147-
apply_manifest_on(master, pp, catch_failures: true)
148-
teardown_puppet_on default
149-
end
150-
# rubocop:disable RepeatedExample
151-
152-
it 'mco should be running' do
153-
on default, 'mco ping' do
154-
hostname = default.hostname.split('.', 2).first
155-
assert_match(%r{^#{hostname}[.\w]*\s+time=}, stdout)
156-
end
157-
end
158-
# rubocop:enable RepeatedExample
159-
160-
it 'works idempotently with no errors' do
161-
pp = <<-EOS
162-
class { 'puppet_agent': collection => "puppet5", service_names => ["mcollective"] }
163-
EOS
164-
165-
# Run it twice and test for idempotency
166-
apply_manifest(pp, catch_failures: true)
167-
wait_for_finish_on default
168-
configure_agent_on default
169-
apply_manifest(pp, catch_changes: true)
170-
wait_for_finish_on default
171-
end
172-
173-
describe package(package_name(default)) do
174-
it { is_expected.to be_installed }
175-
end
176-
177-
describe service('mcollective') do
178-
it { is_expected.to be_enabled }
179-
it { is_expected.to be_running }
180-
end
181-
182-
# rubocop:disable RepeatedExample
183-
it 'has mcollective correctly configured' do
184-
on default, 'mco ping' do
185-
hostname = default.hostname.split('.', 2).first
186-
assert_match(%r{^#{hostname}[.\w]*\s+time=}, stdout)
187-
end
188-
end
189-
# rubocop:enable RepeatedExample
190-
end
191-
192122
unless %r{solaris-10|aix|osx|windows}i.match?(default['platform'])
193123
context 'on platforms managed with the package resource' do
194124
before(:all) { setup_puppet_on default }
-3.84 KB
Binary file not shown.
-1.43 KB
Binary file not shown.

0 commit comments

Comments
 (0)