2 changes: 1 addition & 1 deletion .github/workflows/static_code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: 'ubuntu-20.04'
steps:
- name: Checkout current PR code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/task_acceptance_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: 'ubuntu-20.04'
steps:
- name: Checkout current PR code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install docker
uses: docker/setup-buildx-action@v1
Expand Down
23 changes: 0 additions & 23 deletions .project

This file was deleted.

17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,23 @@ 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.16.0](https://github.com/puppetlabs/puppetlabs-puppet_agent/tree/v4.16.0) - 2023-11-15

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

### Added

- (PA-5065) Add Ubuntu 22.04 (ARM64) to the puppet_agent module [#676](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/676) ([imaqsood](https://github.com/imaqsood))
- (PA-5013) Add Red Hat 9 (ARM64) to the puppet_agent module task [#675](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/675) ([skyamgarp](https://github.com/skyamgarp))
- (PA-5266) Change checksum algorithm to SHA256 [#670](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/670) ([mhashizume](https://github.com/mhashizume))

### Fixed

- (PA-5826) Only read Windows VERSION file during puppet apply [#677](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/677) ([joshcooper](https://github.com/joshcooper))
- (PA-5820) Correct parameter types [#673](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/673) ([mhashizume](https://github.com/mhashizume))
- Match allowed datatypes to yumrepo skip_if_unavailable support [#672](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/672) ([seanmil](https://github.com/seanmil))
- (maint) Update optional parameters [#671](https://github.com/puppetlabs/puppetlabs-puppet_agent/pull/671) ([mhashizume](https://github.com/mhashizume))

## [v4.15.0](https://github.com/puppetlabs/puppetlabs-puppet_agent/tree/v4.15.0) - 2023-09-20

[Full Changelog](https://github.com/puppetlabs/puppetlabs-puppet_agent/compare/v4.14.0...v4.15.0)
Expand Down
6 changes: 3 additions & 3 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# default to phoenix
* @puppetlabs/phoenix
* @puppetlabs/phoenix @bastelfreak

# tasks
/tasks @puppetlabs/bolt
/task_spec @puppetlabs/bolt
/tasks @puppetlabs/bolt @bastelfreak
/task_spec @puppetlabs/bolt @bastelfreak
38 changes: 20 additions & 18 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@

### <a name="puppet_agent"></a>`puppet_agent`

example for clients in dmz:s that need to use proxy to reach the repo
provided by puppetserver.
Upgrades Puppet 4 and newer to the requested version.

#### Parameters

Expand Down Expand Up @@ -343,22 +342,24 @@ Default value: `[]`
Data type: `Optional`

This is to be able to configure yum-repo with proxy, needed for
example for clients in DMZs that need to use proxy to reach the repo
provided by puppetserver.

Default value: `undef`

##### <a name="-puppet_agent--version_file_path"></a>`version_file_path`

Data type: `String`
Data type: `Stdlib::Absolutepath`

The default install path for the VERSION file

Default value: `$facts['os']['family'] ? { 'windows' => "${facts['env_windows_installdir']}\\VERSION", default => '/opt/puppetlabs/puppet/VERSION'`
Default value: `'/opt/puppetlabs/puppet/VERSION'`

##### <a name="-puppet_agent--skip_if_unavailable"></a>`skip_if_unavailable`

Data type: `String`

Data type: `Variant[Boolean, String]`

For yum-based repositories, set the skip_if_unavailable option of the `yumrepo` type.

Default value: `'absent'`

Expand Down Expand Up @@ -396,7 +397,7 @@ Default value: `'present'`

##### <a name="-puppet_agent--install--install_dir"></a>`install_dir`

Data type: `Optional`
Data type: `Optional[Stdlib::Absolutepath]`

The directory the puppet agent should be installed to. This is only applicable for
windows operating systems.
Expand All @@ -405,7 +406,7 @@ Default value: `undef`

##### <a name="-puppet_agent--install--install_options"></a>`install_options`

Data type: `Array`
Data type: `Array[Variant[String, Hash]]`

An array of additional options to pass when installing puppet-agent. Each option in
the array can either be a string or a hash. Each option will automatically be quoted
Expand All @@ -430,13 +431,13 @@ The following parameters are available in the `puppet_agent::install::darwin` cl

##### <a name="-puppet_agent--install--darwin--package_version"></a>`package_version`

Data type: `Optional`
Data type: `String`

The puppet-agent version to install.

##### <a name="-puppet_agent--install--darwin--install_options"></a>`install_options`

Data type: `Array`
Data type: `Array[Variant[String, Hash]]`

An array of additional options to pass when installing puppet-agent. Each option in
the array can either be a string or a hash. Each option will automatically be quoted
Expand All @@ -461,13 +462,13 @@ The following parameters are available in the `puppet_agent::install::solaris` c

##### <a name="-puppet_agent--install--solaris--package_version"></a>`package_version`

Data type: `Optional`
Data type: `String`

The puppet-agent version to install.

##### <a name="-puppet_agent--install--solaris--install_options"></a>`install_options`

Data type: `Array`
Data type: `Array[Variant[String, Hash]]`

An array of additional options to pass when installing puppet-agent. Each option in
the array can either be a string or a hash. Each option will automatically be quoted
Expand All @@ -492,13 +493,13 @@ The following parameters are available in the `puppet_agent::install::suse` clas

##### <a name="-puppet_agent--install--suse--package_version"></a>`package_version`

Data type: `Optional`
Data type: `String`

The puppet-agent version to install.

##### <a name="-puppet_agent--install--suse--install_options"></a>`install_options`

Data type: `Array`
Data type: `Array[Variant[String, Hash]]`

An array of additional options to pass when installing puppet-agent.
Each option in the array can either be a string or a hash.
Expand All @@ -524,7 +525,7 @@ The following parameters are available in the `puppet_agent::install::windows` c

##### <a name="-puppet_agent--install--windows--install_options"></a>`install_options`

Data type: `Array`
Data type: `Array[Variant[String, Hash]]`

An array of additional options to pass when installing puppet-agent. Each option in
the array can either be a string or a hash. Each option will automatically be quoted
Expand Down Expand Up @@ -608,9 +609,10 @@ The following parameters are available in the `puppet_agent::prepare::package` c

##### <a name="-puppet_agent--prepare--package--source"></a>`source`

Data type: `Optional`

Data type: `Variant[String, Array]`

The source file for the puppet-agent package. Can use any of the data types
and protocols that the File resource's source attribute can.

### <a name="puppet_agent--prepare--puppet_config"></a>`puppet_agent::prepare::puppet_config`

Expand All @@ -624,7 +626,7 @@ The following parameters are available in the `puppet_agent::prepare::puppet_con

##### <a name="-puppet_agent--prepare--puppet_config--package_version"></a>`package_version`

Data type: `Optional`
Data type: `String`

The puppet-agent version to install.

Expand Down
3 changes: 3 additions & 0 deletions lib/facter/puppet_runmode.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Facter.add(:puppet_runmode) do
setcode { Puppet.run_mode.name.to_s }
end
15 changes: 10 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@
# This parameter is constrained to managing only a predetermined set of configuration
# settings, e.g. runinterval.
# @param proxy
# This is to be able to configure yum-repo with proxy, needed for
# example for clients in dmz:s that need to use proxy to reach the repo
# This is to be able to configure yum-repo with proxy, needed for
# example for clients in DMZs that need to use proxy to reach the repo
# provided by puppetserver.
# @param version_file_path
# The default install path for the VERSION file
# @param skip_if_unavailable
# For yum-based repositories, set the skip_if_unavailable option of the `yumrepo` type.
# @param disable_proxy
class puppet_agent (
String $arch = $facts['os']['architecture'],
Expand All @@ -125,12 +126,12 @@
Boolean $disable_proxy = false,
Optional $proxy = undef,
Array $install_options = [],
String $skip_if_unavailable = 'absent',
Variant[Boolean, String] $skip_if_unavailable = 'absent',
Boolean $msi_move_locked_files = false,
Optional $wait_for_pxp_agent_exit = undef,
Optional $wait_for_puppet_run = undef,
Array[Puppet_agent::Config] $config = [],
String $version_file_path = $facts['os']['family'] ? { 'windows' => "${facts['env_windows_installdir']}\\VERSION", default => '/opt/puppetlabs/puppet/VERSION' }
Stdlib::Absolutepath $version_file_path = '/opt/puppetlabs/puppet/VERSION'
) inherits puppet_agent::params {
# The configure class uses $puppet_agent::config to manage settings in
# puppet.conf, and will always be present. It does not require management of
Expand Down Expand Up @@ -166,7 +167,11 @@
# 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 = chomp(file($version_file_path))
if $facts['os']['family'] == 'windows' and $facts['puppet_runmode'] == 'user' {
$master_or_package_version = chomp(file("${facts['env_windows_installdir']}\\VERSION"))
} else {
$master_or_package_version = chomp(file($version_file_path))
}
} else {
$master_or_package_version = $package_version
}
Expand Down
6 changes: 3 additions & 3 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
# are in `file` resources.) Note also that backslashes in double-quoted strings _must_
# be escaped and backslashes in single-quoted strings _can_ be escaped.
class puppet_agent::install (
String $package_version = 'present',
Optional $install_dir = undef,
Array $install_options = [],
String $package_version = 'present',
Optional[Stdlib::Absolutepath] $install_dir = undef,
Array[Variant[String, Hash]] $install_options = [],
) {
assert_private()

Expand Down
4 changes: 2 additions & 2 deletions manifests/install/darwin.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# are in `file` resources.) Note also that backslashes in double-quoted strings _must_
# be escaped and backslashes in single-quoted strings _can_ be escaped.
class puppet_agent::install::darwin (
Optional $package_version,
Array $install_options = [],
String $package_version,
Array[Variant[String, Hash]] $install_options = [],
) {
assert_private()
$install_script = 'osx_install.sh.erb'
Expand Down
4 changes: 2 additions & 2 deletions manifests/install/solaris.pp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# are in `file` resources.) Note also that backslashes in double-quoted strings _must_
# be escaped and backslashes in single-quoted strings _can_ be escaped.
class puppet_agent::install::solaris (
Optional $package_version,
Array $install_options = [],
String $package_version,
Array[Variant[String, Hash]] $install_options = [],
) {
assert_private()
if $facts['os']['release']['major'] == '10' {
Expand Down
4 changes: 2 additions & 2 deletions manifests/install/suse.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# `file` resources.) Note also that backslashes in double-quoted strings
# _must_ be escaped and backslashes in single-quoted strings _can_ be escaped.
class puppet_agent::install::suse (
Optional $package_version,
Array $install_options = [],
String $package_version,
Array[Variant[String, Hash]] $install_options = [],
) {
assert_private()

Expand Down
2 changes: 1 addition & 1 deletion manifests/install/windows.pp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# windows operating systems.
class puppet_agent::install::windows (
Optional $install_dir = undef,
Array $install_options = [],
Array[Variant[String, Hash]] $install_options = [],
) {
assert_private()

Expand Down
17 changes: 9 additions & 8 deletions manifests/prepare/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
# working with a remote https repository.
#
# @param source
# The source file for the puppet-agent package. Can use any of the data types
# and protocols that the File resource's source attribute can.
class puppet_agent::prepare::package (
Optional $source,
Variant[String, Array] $source,
) {
assert_private()

Expand All @@ -27,12 +29,11 @@
}

file { $local_package_file_path:
ensure => file,
owner => $puppet_agent::params::user,
group => $puppet_agent::params::group,
mode => $mode,
source => $source,
require => File[$puppet_agent::params::local_packages_dir],
checksum => sha256lite,
ensure => file,
owner => $puppet_agent::params::user,
group => $puppet_agent::params::group,
mode => $mode,
source => $source,
require => File[$puppet_agent::params::local_packages_dir],
}
}
2 changes: 1 addition & 1 deletion manifests/prepare/puppet_config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# @param package_version
# The puppet-agent version to install.
class puppet_agent::prepare::puppet_config (
Optional $package_version,
String $package_version,
) {
assert_private()
$puppetconf = $puppet_agent::params::config
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.15.0",
"version": "4.16.0",
"author": "puppetlabs",
"summary": "Upgrades All-In-One Puppet Agents",
"license": "Apache-2.0",
Expand Down
Loading