Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2022' ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 6
Expand All @@ -26,7 +26,7 @@ jobs:
os_type: 'macOS'
env_set_cmd: 'export '
gem_file: 'puppet-latest-universal-darwin.gem'
- os: 'windows-2016'
- os: 'windows-2022'
os_type: 'Windows'
env_set_cmd: '$env:'
gem_file: 'puppet-latest-x64-mingw32.gem'
Expand All @@ -43,7 +43,7 @@ jobs:

- name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem
run: |
curl http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem
curl https://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem --location
gem install puppet.gem -N
- name: Prepare testing environment with bundler
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit_tests_with_nightly_puppet_gem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2022' ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 6
Expand All @@ -28,7 +28,7 @@ jobs:
os_type: 'macOS'
env_set_cmd: 'export '
gem_file: 'puppet-latest-universal-darwin.gem'
- os: 'windows-2016'
- os: 'windows-2022'
os_type: 'Windows'
env_set_cmd: '$env:'
gem_file: 'puppet-latest-x64-mingw32.gem'
Expand All @@ -45,7 +45,7 @@ jobs:

- name: Install the latest nightly build of puppet${{ matrix.puppet_version }} gem
run: |
curl http://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem
curl https://nightlies.puppet.com/downloads/gems/puppet${{ matrix.puppet_version }}-nightly/${{ matrix.gem_file }} --output puppet.gem --location
gem install puppet.gem -N
- name: Prepare testing environment with bundler
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests_with_released_puppet_gem.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: ${{ matrix.os_type }} / Puppet${{ matrix.puppet_version }} gem / Ruby ${{ matrix.ruby }}
strategy:
matrix:
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2016' ]
os: [ 'ubuntu-18.04', 'macos-10.15', 'windows-2022' ]
puppet_version: [ 6, 7 ]
include:
- puppet_version: 6
Expand All @@ -24,7 +24,7 @@ jobs:
os_type: 'Linux'
- os: 'macos-10.15'
os_type: 'macOS'
- os: 'windows-2016'
- os: 'windows-2022'
os_type: 'Windows'

runs-on: ${{ matrix.os }}
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).

## [v4.11.0](https://github.com/puppetlabs/puppetlabs-puppet_agent/tree/v4.11.0) (2022-05-13)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-puppet_agent/compare/v4.10.0...v4.11.0)

### Added

- \(maint\) Add macOS 12 [\#602](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/602) ([joshcooper](https://github.com/joshcooper))

### Fixed

- \(MODULES-11315\) Updates AIO auto version logic [\#604](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/604) ([mhashizume](https://github.com/mhashizume))
- DOC-5213 install\_options for gMSAs [\#601](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/601) ([aimurphy](https://github.com/aimurphy))

## [v4.10.0](https://github.com/puppetlabs/puppetlabs-puppet_agent/tree/v4.10.0) (2022-01-26)

[Full Changelog](https://github.com/puppetlabs/puppetlabs-puppet_agent/compare/4.9.0...v4.10.0)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,12 @@ The Puppet installer can disable the [Windows path length limit](https://docs.mi
install_options => ['PUPPET_AGENT_ACCOUNT_DOMAIN=ExampleCorp', 'PUPPET_AGENT_ACCOUNT_USER=bob', 'PUPPET_AGENT_ACCOUNT_PASSWORD=password', 'ENABLE_LONG_PATHS=true']
```

For [gMSAs](https://docs.microsoft.com/en-us/windows-server/security/group-managed-service-accounts/group-managed-service-accounts-overview), you must specify the domain and gMSA user, such as:

``` puppet
install_options => ['PUPPET_AGENT_ACCOUNT_DOMAIN=<AGENT_DOMAIN_NAME>', 'PUPPET_AGENT_ACCOUNT_USER=<gMSA_USER>']
```

##### `msi_move_locked_files`

This is only applicable for Windows operating systems and for Puppet 5 prior to 5.5.17 or Puppet 6 prior to 6.8.0. There may be instances where file locks cause unnecessary service restarts. By setting to true, the module will move files prior to installation that are known to cause file locks. By default this is set to false.
Expand Down
8 changes: 4 additions & 4 deletions acceptance/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org"
#
# @param place_or_version can be one of:
# - A specific version,
# - A git branch, as `git://<your-repo>.git#<branch-name>`
# - A git branch, as `https://<your-repo>.git#<branch-name>`
# - A file URI, as `file:///absolute/file/path`
def location_for(place, fake_version = nil)
if place =~ /^(git[:@][^#]*)#(.*)/
if place.is_a?(String) && place =~ /^((?:git[:@]|https:)[^#]*)#(.*)/
[fake_version, { git: $1, branch: $2, require: false }].compact
elsif place =~ /^file:\/\/(.*)/
elsif place.is_a?(String) && place =~ /^file:\/\/(.*)/
['>= 0', { path: File.expand_path($1), require: false }]
else
[place, { require: false }]
Expand All @@ -19,7 +19,7 @@ end
gem "rake", "~> 12.3"

gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 4')
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || 'git://github.com/voxpupuli/beaker-puppet#master')
gem "beaker-puppet", *location_for(ENV['BEAKER_PUPPET_VERSION'] || 'https://github.com/voxpupuli/beaker-puppet#master')

gem "beaker-docker", *location_for(ENV['BEAKER_DOCKER_VERSION'] || '~> 0')
gem "beaker-vagrant", *location_for(ENV['BEAKER_VAGRANT_VERSION'] || '~> 0')
Expand Down
2 changes: 1 addition & 1 deletion acceptance/tests/test_upgrade_puppet5_to_puppet6.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class { puppet_agent:
agents_only.each do |agent|
on(agent, puppet('agent -t --debug'), acceptable_exit_codes: 2)
wait_for_installation_pid(agent)
assert_agent_version_on(agent, latest_version.scan(%r{6\.\d*\.\d*\.\d*}).first)
assert(puppet_agent_version_on(agent) =~ %r{^6\.\d+\.\d+.*})
end
end

Expand Down
2 changes: 1 addition & 1 deletion acceptance/tests/test_upgrade_puppet6_to_puppet7.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class { puppet_agent:
agents_only.each do |agent|
on(agent, puppet('agent -t --debug'), acceptable_exit_codes: 2)
wait_for_installation_pid(agent)
assert_agent_version_on(agent, latest_version.scan(%r{7\.\d*\.\d*\.\d*}).first)
assert(puppet_agent_version_on(agent) =~ %r{^7\.\d+\.\d+.*})
end
end

Expand Down
4 changes: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,10 @@
fail('Unable to install x64 on a x86 system')
}

# The AIO package version and Puppet version can, on rare occasion, diverge.
# This logic checks for the AIO version of the server, since that's what the package manager cares about.
if $package_version == 'auto' {
$master_or_package_version = $::serverversion
$master_or_package_version = chomp(file('/opt/puppetlabs/puppet/VERSION'))
} else {
$master_or_package_version = $package_version
}
Expand Down
160 changes: 41 additions & 119 deletions metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-puppet_agent",
"version": "4.10.0",
"version": "4.11.0",
"author": "puppetlabs",
"summary": "Upgrades All-In-One Puppet Agents",
"license": "Apache-2.0",
Expand All @@ -27,124 +27,46 @@
],
"operatingsystem_support": [
{
"operatingsystem": "RedHat",
"operatingsystemrelease": [
"5",
"6",
"7",
"8"
]
},
{
"operatingsystem": "CentOS",
"operatingsystemrelease": [
"5",
"6",
"7",
"8"
]
},
{
"operatingsystem": "OracleLinux",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "Scientific",
"operatingsystemrelease": [
"5",
"6",
"7"
]
},
{
"operatingsystem": "SLES",
"operatingsystemrelease": [
"11",
"12",
"15"
]
},
{
"operatingsystem": "Debian",
"operatingsystemrelease": [
"8",
"9",
"10",
"11"
]
},
{
"operatingsystem": "Ubuntu",
"operatingsystemrelease": [
"14.04",
"16.04",
"18.04",
"20.04"
]
},
{
"operatingsystem": "Fedora",
"operatingsystemrelease": [
"28",
"29",
"30",
"31",
"32",
"34"
]
},
{
"operatingsystem": "Solaris",
"operatingsystemrelease": [
"10",
"11"
]
},
{
"operatingsystem": "Windows",
"operatingsystemrelease": [
"Server 2008",
"Server 2008 R2",
"Server 2012",
"Server 2012 R2",
"Server 2016",
"Server 2019",
"7",
"8",
"8.1",
"10"
]
},
{
"operatingsystem": "AIX",
"operatingsystemrelease": [
"7.1",
"7.2"
]
},
{
"operatingsystem": "OSX",
"operatingsystemrelease": [
"10.14",
"10.15",
"11"
]
},
{
"operatingsystem": "AlmaLinux",
"operatingsystemrelease": [
"8"
]
},
{
"operatingsystem": "Rocky",
"operatingsystemrelease": [
"8"
]
"operatingsystem": "RedHat"
},
{
"operatingsystem": "CentOS"
},
{
"operatingsystem": "OracleLinux"
},
{
"operatingsystem": "Scientific"
},
{
"operatingsystem": "SLES"
},
{
"operatingsystem": "Debian"
},
{
"operatingsystem": "Ubuntu"
},
{
"operatingsystem": "Fedora"
},
{
"operatingsystem": "Solaris"
},
{
"operatingsystem": "Windows"
},
{
"operatingsystem": "AIX"
},
{
"operatingsystem": "OSX"
},
{
"operatingsystem": "AlmaLinux"
},
{
"operatingsystem": "Rocky"
}
],
"requirements": [
Expand Down
7 changes: 7 additions & 0 deletions spec/classes/puppet_agent_osfamily_aix_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
}
end

before(:each) do
allow(Puppet::FileSystem).to receive(:exist?).and_call_original
allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).and_call_original
allow(Puppet::FileSystem).to receive(:exist?).with('/opt/puppetlabs/puppet/VERSION').and_return true
allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).with('/opt/puppetlabs/puppet/VERSION').and_return "5.10.200\n"
end

shared_examples 'aix' do |aixver, pkg_aixver, powerver|
let(:rpmname) { "puppet-agent-#{params[:package_version]}-1.aix#{pkg_aixver}.ppc.rpm" }
let(:tag) { "aix-#{pkg_aixver}-power" }
Expand Down
7 changes: 6 additions & 1 deletion spec/classes/puppet_agent_osfamily_darwin_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
master_package_version
end

allow(Puppet::FileSystem).to receive(:exist?).and_call_original
allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).and_call_original
allow(Puppet::FileSystem).to receive(:exist?).with('/opt/puppetlabs/puppet/VERSION').and_return true
allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).with('/opt/puppetlabs/puppet/VERSION').and_return "5.10.200\n"
end

package_version = '1.10.100'
Expand All @@ -31,7 +36,7 @@
let(:params) { { package_version: package_version } }

context 'when running a supported OSX' do
['osx-10.12-x86_64', 'osx-10.13-x86_64', 'osx-10.14-x86_64', 'osx-10.15-x86_64', 'osx-11-x86_64'].each do |tag|
['osx-10.15-x86_64', 'osx-11-x86_64', 'osx-12-x86_64'].each do |tag|
context "on #{tag} with no aio_version" do
let(:osmajor) { tag.split('-')[1] }

Expand Down
8 changes: 8 additions & 0 deletions spec/classes/puppet_agent_osfamily_windows_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
pe_version = '2000.0.0'

let(:params) { { package_version: package_version } }
let(:version_file) { '/opt/puppetlabs/puppet/VERSION' }

before(:each) do
# Need to mock the PE functions
Expand All @@ -15,6 +16,13 @@
Puppet::Parser::Functions.newfunction(:pe_compiling_server_aio_build, type: :rvalue) do |_args|
package_version
end

allow(Puppet::Util).to receive(:absolute_path?).and_call_original
allow(Puppet::Util).to receive(:absolute_path?).with(version_file).and_return true
allow(Puppet::FileSystem).to receive(:exist?).and_call_original
allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).and_call_original
allow(Puppet::FileSystem).to receive(:exist?).with(version_file).and_return true
allow(Puppet::FileSystem).to receive(:read_preserve_line_endings).with(version_file).and_return "1.10.100\n"
end

[['x64', 'x86_64'], ['x86', 'i386']].each do |arch, tag|
Expand Down
Loading