Showing with 72 additions and 11 deletions.
  1. +3 −3 .github/workflows/auto_release.yml
  2. +13 −0 CHANGELOG.md
  3. +1 −1 metadata.json
  4. +2 −1 rakelib/commits.rake
  5. +37 −6 task_spec/spec/acceptance/init_spec.rb
  6. +15 −0 tasks/install_powershell.ps1
  7. +1 −0 tasks/install_shell.sh
6 changes: 3 additions & 3 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,22 @@ jobs:
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
git commit -m "(packaging) Release prep v${{ steps.gv.outputs.ver }}"
- name: Create Pull Request
id: cpr
uses: puppetlabs/peter-evans-create-pull-request@v3
if: ${{ github.repository_owner == 'puppetlabs' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
commit-message: "(packaging) Release prep v${{ steps.gv.outputs.ver }}"
branch: "release-prep"
delete-branch: true
title: "Release prep v${{ steps.gv.outputs.ver }}"
body: |
Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}.
Please verify before merging:
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green
- [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/daily_unit_tests_with_nightly_puppet_gem.yaml) run is green
- [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests
- [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match
labels: "maintenance"
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.12.0](https://github.com/puppetlabs/puppetlabs-puppet_agent/tree/v4.12.0) (2022-07-13)

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

### Added

- \(FM-8943\) Add Ubuntu 22.04 to puppet\_agent module [\#610](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/610) ([AriaXLi](https://github.com/AriaXLi))
- \(maint\) Adds cases for newly-supported OSes [\#607](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/607) ([mhashizume](https://github.com/mhashizume))

### Fixed

- \(MODULES-11334\) Handle TLS 1.2 on older Windows systems [\#611](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/611) ([chelnak](https://github.com/chelnak))

## [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)
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "puppetlabs-puppet_agent",
"version": "4.11.0",
"version": "4.12.0",
"author": "puppetlabs",
"summary": "Upgrades All-In-One Puppet Agents",
"license": "Apache-2.0",
Expand Down
3 changes: 2 additions & 1 deletion rakelib/commits.rake
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ task(:commits) do
%x{git log --no-merges --pretty=%s #{commit_range}}.each_line do |commit_summary|
# This regex tests for the currently supported commit summary tokens.
# The exception tries to explain it in more full.
if /^\((maint|packaging|doc|docs|modules-\d+)\)|revert/i.match(commit_summary).nil?
if /^\((maint|packaging|doc|docs|fm-\d+|modules-\d+)\)|revert/i.match(commit_summary).nil?
raise "\n\n\n\tThis commit summary didn't match CONTRIBUTING.md guidelines:\n" \
"\n\t\t#{commit_summary}\n" \
"\tThe commit summary (i.e. the first line of the commit message) should start with one of:\n" \
"\t\t(MODULES-<digits>) # this is most common and should be a ticket at tickets.puppet.com\n" \
"\t\t(FM-<digits>)\n" \
"\t\t(docs)\n" \
"\t\t(docs)(DOCUMENT-<digits>)\n" \
"\t\t(packaging)\n"
Expand Down
43 changes: 37 additions & 6 deletions task_spec/spec/acceptance/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ def target_platform

it 'works with version and install tasks' do
puppet_6_version = case target_platform
when %r{debian-11}
'6.24.0'
when %r{el-9}
'6.26.0'
when %r{fedora-30}
'6.19.1'
when %r{fedora-31}
'6.20.0'
when %r{fedora-34}
'6.23.0'
when %r{osx-10.14}
'6.18.0'
when %r{osx-10.15}
Expand All @@ -46,14 +52,28 @@ def target_platform
'6.23.0'
when %r{osx-12}
'6.27.1'
when %r{ubuntu-22.04}
'latest'
else
'6.17.0'
end

# platforms that only have nightly builds available
case target_platform
when %r{ubuntu-22.04}
puppet_6_collection = 'puppet6-nightly'
puppet_7_collection = 'puppet7-nightly'
else
puppet_6_collection = 'puppet6'
puppet_7_collection = 'puppet7'
end

# we can only tests puppet 6.x -> 6.y upgrades if there multiple versions
multiple_puppet6_versions = case target_platform
when %r{osx-12}
false
when %r{ubuntu-22.04}
false
else
true
end
Expand All @@ -70,16 +90,21 @@ def target_platform
end

# Try to install an older puppet6 version
results = run_task('puppet_agent::install', 'target', { 'collection' => 'puppet6',
results = run_task('puppet_agent::install', 'target', { 'collection' => puppet_6_collection,
'version' => puppet_6_version,
'stop_service' => true })

expect(results).to all(include('status' => 'success'))

# It installed a version older than latest puppet6
results = run_task('puppet_agent::version', 'target', {})
results.each do |res|
expect(res).to include('status' => 'success')
expect(res['value']['version']).to eq(puppet_6_version)
if puppet_6_version == 'latest'
expect(res['value']['version']).to match(%r{^6\.\d+\.\d+})
else
expect(res['value']['version']).to eq(puppet_6_version)
end
expect(res['value']['source']).to be
end

Expand All @@ -94,7 +119,8 @@ def target_platform

# Try to upgrade with no specific version given in parameter
# Expect nothing to happen and receive a message regarding this
results = run_task('puppet_agent::install', 'target', { 'collection' => 'puppet6' })
results = run_task('puppet_agent::install', 'target', { 'collection' => puppet_6_collection })

results.each do |res|
expect(res).to include('status' => 'success')
expect(res['value']['_output']).to match(%r{Version parameter not defined and agent detected. Nothing to do.})
Expand All @@ -104,7 +130,11 @@ def target_platform
results = run_task('puppet_agent::version', 'target', {})
results.each do |res|
expect(res).to include('status' => 'success')
expect(res['value']['version']).to eq(puppet_6_version)
if puppet_6_version == 'latest'
expect(res['value']['version']).to match(%r{^6\.\d+\.\d+})
else
expect(res['value']['version']).to eq(puppet_6_version)
end
expect(res['value']['source']).to be
end

Expand Down Expand Up @@ -142,7 +172,7 @@ def target_platform
end

# Succesfully upgrade from puppet6 to puppet7
results = run_task('puppet_agent::install', 'target', { 'collection' => 'puppet7', 'version' => 'latest' })
results = run_task('puppet_agent::install', 'target', { 'collection' => puppet_7_collection, 'version' => 'latest' })
expect(results).to all(include('status' => 'success'))

# Verify that it upgraded
Expand All @@ -158,7 +188,8 @@ def target_platform

# Try installing the same version again
# Expect nothing to happen and receive a message regarding this
results = run_task('puppet_agent::install', 'target', { 'collection' => 'puppet7', 'version' => installed_version })
results = run_task('puppet_agent::install', 'target', { 'collection' => puppet_7_collection, 'version' => installed_version })

results.each do |res|
expect(res).to include('status' => 'success')
expect(res['value']['_output']).to match(%r{Puppet Agent #{installed_version} detected. Nothing to do.})
Expand Down
15 changes: 15 additions & 0 deletions tasks/install_powershell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,23 @@ $date_time_stamp = (Get-Date -format s) -replace ':', '-'
$msi_dest = Join-Path ([System.IO.Path]::GetTempPath()) "puppet-agent-$arch.msi"
$install_log = Join-Path ([System.IO.Path]::GetTempPath()) "$date_time_stamp-puppet-install.log"

# Most modern sites either require or are starting to require TLS 1.2.
# On older Windows systems the default security protocols for PowerShell 5 are SSL3 and TLS 1.0.
# When communicating with a site that has a higher TLS requirement requests will fail with the following error:
# `Could not create SSL/TLS secure channel`.`
# Set-Tls12 will add TLS 1.2 to the list of available security protocols if it is not already present.
function Set-Tls12 {
$Tls12 = [System.Net.SecurityProtocolType]::Tls12
$CurrentSecurityProtocolList = [System.Net.ServicePointManager]::SecurityProtocol
if (!$CurrentSecurityProtocolList.HasFlag($Tls12)) {
[System.Net.ServicePointManager]::SecurityProtocol = $CurrentSecurityProtocolList, [System.Net.SecurityProtocolType]::Tls12
}
}

function DownloadPuppet {
Write-Output "Downloading the Puppet Agent installer on $env:COMPUTERNAME..."
Set-Tls12

$webclient = New-Object system.net.webclient

try {
Expand Down
1 change: 1 addition & 0 deletions tasks/install_shell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,7 @@ case $platform in
"17.04") deb_codename="zesty";;
"18.04") deb_codename="bionic";;
"20.04") deb_codename="focal";;
"22.04") deb_codename="jammy";;
esac
filetype="deb"
filename="${collection}-release-${deb_codename}.deb"
Expand Down