From cac524c93d0ee618d3fb93fd99f69a97d1cd7fa3 Mon Sep 17 00:00:00 2001 From: Aria Li Date: Wed, 30 Aug 2023 13:22:03 -0700 Subject: [PATCH] (maint) Update documentation and format/style for puppet-lint --- REFERENCE.md | 499 +++++++++--------- Rakefile | 4 + docker/upgrade.pp | 2 +- examples/init.pp | 2 +- lib/puppet/functions/any_resources_of_type.rb | 5 + .../parser/functions/uri_host_from_string.rb | 2 +- .../functions/windows_msi_installargs.rb | 2 +- .../parser/functions/windows_native_path.rb | 3 +- .../puppet_agent_end_run.rb | 2 + .../puppet_agent_upgrade_error.rb | 6 + manifests/configure.pp | 3 + manifests/init.pp | 128 ++--- manifests/install.pp | 40 +- manifests/install/darwin.pp | 24 +- manifests/install/solaris.pp | 32 +- manifests/install/suse.pp | 24 +- manifests/install/windows.pp | 67 ++- manifests/osfamily/aix.pp | 26 +- manifests/osfamily/darwin.pp | 22 +- manifests/osfamily/debian.pp | 40 +- manifests/osfamily/redhat.pp | 54 +- manifests/osfamily/solaris.pp | 38 +- manifests/osfamily/suse.pp | 46 +- manifests/osfamily/windows.pp | 30 +- manifests/params.pp | 4 +- manifests/prepare.pp | 9 +- manifests/prepare/package.pp | 22 +- manifests/prepare/puppet_config.pp | 10 +- manifests/service.pp | 10 +- .../classes/puppet_agent_osfamily_aix_spec.rb | 2 +- .../puppet_agent_osfamily_darwin_spec.rb | 6 +- .../puppet_agent_osfamily_debian_spec.rb | 4 +- .../puppet_agent_osfamily_redhat_spec.rb | 10 +- .../puppet_agent_osfamily_solaris_spec.rb | 24 +- .../puppet_agent_osfamily_suse_spec.rb | 14 +- .../puppet_agent_osfamily_windows_spec.rb | 6 +- types/arch.pp | 1 + types/config.pp | 1 + 38 files changed, 669 insertions(+), 555 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 8650e9ce0..e622ba7f0 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -6,24 +6,24 @@ ### Classes -* [`puppet_agent`](#puppet_agent): == Class: puppet_agent Upgrades Puppet 4 and newer to the requested version. === Parameters [arch] The package architecture. Defaults to -* [`puppet_agent::configure`](#puppet_agent--configure) -* [`puppet_agent::install`](#puppet_agent--install): == Class puppet_agent::install This class is called from puppet_agent for install. === Parameters [version] The puppet-agent version to +* [`puppet_agent`](#puppet_agent): == Class: puppet_agent Upgrades Puppet 4 and newer to the requested version. === Parameters example for clients in dmz:s that need to us +* [`puppet_agent::configure`](#puppet_agent--configure): This class uses $puppet_agent::config to manage settings in +* [`puppet_agent::install`](#puppet_agent--install): == Class puppet_agent::install This class is called from puppet_agent for install. === Parameters * [`puppet_agent::install::darwin`](#puppet_agent--install--darwin): == Class puppet_agent::install::darwin Private class called from puppet_agent class Manage the install process for Darwin OSes specifically -* [`puppet_agent::install::solaris`](#puppet_agent--install--solaris): == Class puppet_agent::install::solaris Private class called from puppet_agent class Manage the install process for solaris specifically -* [`puppet_agent::install::suse`](#puppet_agent--install--suse): == Class puppet_agent::install::suse Private class called from puppet_agent class Manage the install process for SUSE OSes specifically -* [`puppet_agent::install::windows`](#puppet_agent--install--windows): == Class puppet_agent::install::windows Private class called from puppet_agent class Manage the install process for windows specifically -* [`puppet_agent::osfamily::aix`](#puppet_agent--osfamily--aix) -* [`puppet_agent::osfamily::darwin`](#puppet_agent--osfamily--darwin) -* [`puppet_agent::osfamily::debian`](#puppet_agent--osfamily--debian) -* [`puppet_agent::osfamily::redhat`](#puppet_agent--osfamily--redhat) -* [`puppet_agent::osfamily::solaris`](#puppet_agent--osfamily--solaris) -* [`puppet_agent::osfamily::suse`](#puppet_agent--osfamily--suse) -* [`puppet_agent::osfamily::windows`](#puppet_agent--osfamily--windows) +* [`puppet_agent::install::solaris`](#puppet_agent--install--solaris): == Class puppet_agent::install::solaris Private class called from puppet_agent class Manage the install process for solaris specifically = +* [`puppet_agent::install::suse`](#puppet_agent--install--suse): == Class puppet_agent::install::suse Private class called from puppet_agent class Manage the install process for SUSE OSes specifically == +* [`puppet_agent::install::windows`](#puppet_agent--install--windows): == Class puppet_agent::install::windows Private class called from puppet_agent class Manage the install process for windows specifically = +* [`puppet_agent::osfamily::aix`](#puppet_agent--osfamily--aix): This private class is used to determine the puppet-agent package +* [`puppet_agent::osfamily::darwin`](#puppet_agent--osfamily--darwin): This private class is used to determine the puppet-agent package +* [`puppet_agent::osfamily::debian`](#puppet_agent--osfamily--debian): This private class is used to determine the puppet-agent package +* [`puppet_agent::osfamily::redhat`](#puppet_agent--osfamily--redhat): This private class is used to determine the puppet-agent package +* [`puppet_agent::osfamily::solaris`](#puppet_agent--osfamily--solaris): This private class is used to determine the puppet-agent package +* [`puppet_agent::osfamily::suse`](#puppet_agent--osfamily--suse): This private class is used to determine the puppet-agent package +* [`puppet_agent::osfamily::windows`](#puppet_agent--osfamily--windows): This private class is used to determine the puppet-agent package * [`puppet_agent::params`](#puppet_agent--params): == Class puppet_agent::params This class is meant to be called from puppet_agent It sets variables according to platform. -* [`puppet_agent::prepare`](#puppet_agent--prepare): == Class puppet_agent::prepare This class is called from puppet_agent to prepare for the upgrade. === Parameters [version] The puppet-ag +* [`puppet_agent::prepare`](#puppet_agent--prepare): == Class puppet_agent::prepare This class is called from puppet_agent to prepare for the upgrade. === Parameters * [`puppet_agent::prepare::package`](#puppet_agent--prepare--package): == Class puppet_agent::prepare::package The only job this class has is to ensure that the correct puppet-agent package is downloaded locally -* [`puppet_agent::prepare::puppet_config`](#puppet_agent--prepare--puppet_config): == Class puppet_agent::prepare::puppet_config Private class called from puppet_agent::prepare class +* [`puppet_agent::prepare::puppet_config`](#puppet_agent--prepare--puppet_config): == Class puppet_agent::prepare::puppet_config Private class called from puppet_agent::prepare class === Parameters * [`puppet_agent::service`](#puppet_agent--service): == Class puppet_agent::service This class is meant to be called from puppet_agent. It ensures that managed services are running. ### Resource types @@ -33,15 +33,15 @@ ### Functions -* [`any_resources_of_type`](#any_resources_of_type) -* [`uri_host_from_string`](#uri_host_from_string): Return a uri host from a string -* [`windows_msi_installargs`](#windows_msi_installargs): Return the $install_options parameter as a string usable in an msiexec command -* [`windows_native_path`](#windows_native_path): Return a windows native path +* [`any_resources_of_type`](#any_resources_of_type): A function used to determine if there are any +* [`uri_host_from_string`](#uri_host_from_string) +* [`windows_msi_installargs`](#windows_msi_installargs) +* [`windows_native_path`](#windows_native_path) ### Data types -* [`Puppet_agent::Arch`](#Puppet_agent--Arch) -* [`Puppet_agent::Config`](#Puppet_agent--Config) +* [`Puppet_agent::Arch`](#Puppet_agent--Arch): This type stores all possible architecture patterns +* [`Puppet_agent::Config`](#Puppet_agent--Config): This Puppet type alias * [`Puppet_agent::Config_setting`](#Puppet_agent--Config_setting): An enumerated list of settings which are permitted to be managed by this module. ### Tasks @@ -70,100 +70,8 @@ Upgrades Puppet 4 and newer to the requested version. === Parameters -[arch] - The package architecture. Defaults to the architecture fact. -[collection] - The Puppet Collection to track. Defaults to 'PC1'. -[is_pe] - Install from Puppet Enterprise repos. Enabled if communicating with a PE master. -[manage_pki_dir] - Whether or not to manage the /etc/pki directory. Defaults to true. - Managing the /etc/pki directory inside the puppet_agent module can be problematic for - organizations that manage gpg keys and settings in other modules. -[manage_repo] - Boolean to determine whether to configure repositories - This is intended to provide the ability to disable configuring a local repo - in support of systems that manage external repositories (i.e. spacewalk/satellite) - to enable users to add the proper packages to their internal repos - and to utilize default package providers for the install -[package_name] - The package to upgrade to, i.e. `puppet-agent`. -[package_version] - The package version to upgrade to. Explicitly specify the version to upgrade to, - or set to 'auto' to specify the version of the compiling master. -[service_names] - An array of services to start, normally `puppet`. - None will be started if the array is empty. -[source] - **INCLUDED FOR COMPATIBILITY WITH MODULE VERSIONS 1.0/2.0. PREFER USE OF "absolute_source", - "apt_source", "deb_source" etc. OVER USE OF "source".** - - The location to find packages. Replaces base URL for unix/MacOS agents, used as fully - qualified path in windows -[absolute_source] - The exact location of the package to install. The entire path to the package must be - provided with this parameter. -[yum_source] - Base URL of the location of mirrors of yum.puppet.com downloads sites. Directories under - the URL "yum_source" should match the structure of the yum.puppet.com -[apt_source] - Base URL of the location of mirrors of apt.puppet.com downloads sites. Directories under - the URL "apt_source" should match the structure of the apt.puppet.com -[mac_source] - Base URL of the location of mirrors of downloads.puppet.com downloads site that serves - MacOS packages. Directories under the URL "mac_source" should match the structure of the - downloads.puppet.com site -[windows_source] - Base URL of the location of mirrors of downloads.puppet.com downloads site that serves - Windows packages. Directories under the URL "windows_source" should match the structure of - the downloads.puppet.com site -[solaris_source] - Base URL of the location of a mirror for Solaris packages. Currently, solaris packages can - only be made available by using puppetlabs-pe_repo. This means the mirror must be of a - PE master package serve. -[aix_source] - Base URL of the location of a mirror for AIX packages. Currently, AIX packages can - only be made available by using puppetlabs-pe_repo. This means the mirror must be of a - PE master package serve. -[use_alternate_sources] - **ONLY APPLICABLE WHEN WORKING WITH PE INSTALLTIONS** - When set to true will force downloads to come from the values of $apt_source, $deb_source - $mac_source etc. rather than from the default PE master package serve. Note that this will - also force downloads to ignore alternate_pe_source -[alternate_pe_source] - Base URL of the location where packages are located in the same structure that's served - by a PE master (the directory structure in PE for serving packages is created by the - puppetlabs-pe_repo module). The general structure served by PE is: - /packages/${pe_server_version}/${platform_tag}/${package_name} -[install_dir] - The directory the puppet agent should be installed to. This is only applicable for - windows operating systems. This only applies when upgrading the agent to a new - version; it will not cause re-installation of the same version to a new location. -[install_options] - 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 - when passed to the install command. With Windows packages, note that file paths in an - install option must use backslashes. (Since install options are passed directly to - the installation command, forward slashes won't be automatically converted like they - are in `file` resources.) Note also that backslashes in double-quoted strings _must_ - be escaped and backslashes in single-quoted strings _can_ be escaped. -[msi_move_locked_files] - This is only applicable for Windows operating systems. There may be instances where - file locks cause unncessary service restarts. By setting to true, the module - will move files prior to installation that are known to cause file locks. -[wait_for_pxp_agent_exit] - This parameter is only applicable for Windows operating systems and pertains to the - /files/install_agent.ps1 script. This parameterizes the module to define the wait time - for the PXP agent to end successfully. The default value is set 2 minutes. -[wait_for_puppet_run] - This parameter is only applicable for Windows operating systems and pertains to the - /files/install_agent.ps1 script. This parameterizes the module to define the wait time - for the current puppet agent run to end successfully. The default value is set 2 minutes. -[config] - An array of configuration data to enforce. Each configuration data item must be a - Puppet_agent::Config hash, which has keys for puppet.conf section, setting, and value. - This parameter is constrained to managing only a predetermined set of configuration - settings, e.g. runinterval. + example for clients in dmz:s that need to use proxy to reach the repo + provided by puppetserver. #### Parameters @@ -188,156 +96,186 @@ The following parameters are available in the `puppet_agent` class: * [`use_alternate_sources`](#-puppet_agent--use_alternate_sources) * [`alternate_pe_source`](#-puppet_agent--alternate_pe_source) * [`install_dir`](#-puppet_agent--install_dir) -* [`disable_proxy`](#-puppet_agent--disable_proxy) -* [`proxy`](#-puppet_agent--proxy) * [`install_options`](#-puppet_agent--install_options) -* [`skip_if_unavailable`](#-puppet_agent--skip_if_unavailable) * [`msi_move_locked_files`](#-puppet_agent--msi_move_locked_files) * [`wait_for_pxp_agent_exit`](#-puppet_agent--wait_for_pxp_agent_exit) * [`wait_for_puppet_run`](#-puppet_agent--wait_for_puppet_run) * [`config`](#-puppet_agent--config) +* [`proxy`](#-puppet_agent--proxy) +* [`version_file_path`](#-puppet_agent--version_file_path) +* [`skip_if_unavailable`](#-puppet_agent--skip_if_unavailable) +* [`disable_proxy`](#-puppet_agent--disable_proxy) ##### `arch` -Data type: `Any` - +Data type: `String` +The package architecture. Defaults to the architecture fact. Default value: `$facts['os']['architecture']` ##### `collection` -Data type: `Any` - +Data type: `String` +The Puppet Collection to track. Defaults to 'PC1'. -Default value: `$::puppet_agent::params::collection` +Default value: `$puppet_agent::params::collection` ##### `is_pe` -Data type: `Any` - +Data type: `Boolean` +Install from Puppet Enterprise repos. Enabled if communicating with a PE master. -Default value: `$::puppet_agent::params::_is_pe` +Default value: `$puppet_agent::params::_is_pe` ##### `manage_pki_dir` -Data type: `Any` - +Data type: `Boolean` +Whether or not to manage the /etc/pki directory. Defaults to true. +Managing the /etc/pki directory inside the puppet_agent module can be problematic for +organizations that manage gpg keys and settings in other modules. Default value: `true` ##### `manage_repo` -Data type: `Any` - +Data type: `Boolean` +Boolean to determine whether to configure repositories +This is intended to provide the ability to disable configuring a local repo +in support of systems that manage external repositories (i.e. spacewalk/satellite) +to enable users to add the proper packages to their internal repos +and to utilize default package providers for the install Default value: `true` ##### `package_name` -Data type: `Any` - +Data type: `String` +The package to upgrade to, i.e. `puppet-agent`. Default value: `'puppet-agent'` ##### `package_version` -Data type: `Any` - +Data type: `Optional` +The package version to upgrade to. Explicitly specify the version to upgrade to, +or set to 'auto' to specify the version of the compiling master. Default value: `undef` ##### `service_names` -Data type: `Any` +Data type: `Array` +An array of services to start, normally `puppet`. +None will be started if the array is empty. - -Default value: `$::puppet_agent::params::service_names` +Default value: `$puppet_agent::params::service_names` ##### `source` -Data type: `Any` +Data type: `Optional` +**INCLUDED FOR COMPATIBILITY WITH MODULE VERSIONS 1.0/2.0. PREFER USE OF "absolute_source", +"apt_source", "deb_source" etc. OVER USE OF "source".** +The location to find packages. Replaces base URL for unix/MacOS agents, used as fully +qualified path in windows Default value: `undef` ##### `absolute_source` -Data type: `Any` - +Data type: `Optional` +The exact location of the package to install. The entire path to the package must be +provided with this parameter. Default value: `undef` ##### `yum_source` -Data type: `Any` - +Data type: `String` +Base URL of the location of mirrors of yum.puppet.com downloads sites. Directories under +the URL "yum_source" should match the structure of the yum.puppet.com Default value: `'http://yum.puppet.com'` ##### `apt_source` -Data type: `Any` - +Data type: `String` +Base URL of the location of mirrors of apt.puppet.com downloads sites. Directories under +the URL "apt_source" should match the structure of the apt.puppet.com Default value: `'https://apt.puppet.com'` ##### `mac_source` -Data type: `Any` - +Data type: `String` +Base URL of the location of mirrors of downloads.puppet.com downloads site that serves +MacOS packages. Directories under the URL "mac_source" should match the structure of the +downloads.puppet.com site Default value: `'https://downloads.puppet.com'` ##### `windows_source` -Data type: `Any` - +Data type: `String` +Base URL of the location of mirrors of downloads.puppet.com downloads site that serves +Windows packages. Directories under the URL "windows_source" should match the structure of +the downloads.puppet.com site Default value: `'https://downloads.puppet.com'` ##### `solaris_source` -Data type: `Any` - +Data type: `String` +Base URL of the location of a mirror for Solaris packages. Currently, solaris packages can +only be made available by using puppetlabs-pe_repo. This means the mirror must be of a +PE master package serve. -Default value: `'puppet:///pe_packages'` +Default value: `'puppet:///modules/pe_packages'` ##### `aix_source` -Data type: `Any` - +Data type: `String` +Base URL of the location of a mirror for AIX packages. Currently, AIX packages can +only be made available by using puppetlabs-pe_repo. This means the mirror must be of a +PE master package serve. -Default value: `'puppet:///pe_packages'` +Default value: `'puppet:///modules/pe_packages'` ##### `use_alternate_sources` -Data type: `Any` - +Data type: `Boolean` +**ONLY APPLICABLE WHEN WORKING WITH PE INSTALLTIONS** +When set to true will force downloads to come from the values of $apt_source, $deb_source +$mac_source etc. rather than from the default PE master package serve. Note that this will +also force downloads to ignore alternate_pe_source Default value: `false` ##### `alternate_pe_source` -Data type: `Any` - +Data type: `Optional` +Base URL of the location where packages are located in the same structure that's served +by a PE master (the directory structure in PE for serving packages is created by the +puppetlabs-pe_repo module). The general structure served by PE is: +/packages/${pe_server_version}/${platform_tag}/${package_name} Default value: `undef` @@ -345,77 +283,103 @@ Default value: `undef` Data type: `Optional[Stdlib::Absolutepath]` - +The directory the puppet agent should be installed to. This is only applicable for +windows operating systems. This only applies when upgrading the agent to a new +version; it will not cause re-installation of the same version to a new location. Default value: `undef` -##### `disable_proxy` - -Data type: `Any` +##### `install_options` +Data type: `Array` +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 +when passed to the install command. With Windows packages, note that file paths in an +install option must use backslashes. (Since install options are passed directly to +the installation command, forward slashes won't be automatically converted like they +are in `file` resources.) Note also that backslashes in double-quoted strings _must_ +be escaped and backslashes in single-quoted strings _can_ be escaped. -Default value: `false` - -##### `proxy` +Default value: `[]` -Data type: `Any` +##### `msi_move_locked_files` +Data type: `Boolean` +This is only applicable for Windows operating systems. There may be instances where +file locks cause unncessary service restarts. By setting to true, the module +will move files prior to installation that are known to cause file locks. -Default value: `undef` +Default value: `false` -##### `install_options` +##### `wait_for_pxp_agent_exit` -Data type: `Any` +Data type: `Optional` +This parameter is only applicable for Windows operating systems and pertains to the +/files/install_agent.ps1 script. This parameterizes the module to define the wait time +for the PXP agent to end successfully. The default value is set 2 minutes. +Default value: `undef` -Default value: `[]` +##### `wait_for_puppet_run` -##### `skip_if_unavailable` +Data type: `Optional` -Data type: `Any` +This parameter is only applicable for Windows operating systems and pertains to the +/files/install_agent.ps1 script. This parameterizes the module to define the wait time +for the current puppet agent run to end successfully. The default value is set 2 minutes. +Default value: `undef` +##### `config` -Default value: `'absent'` +Data type: `Array[Puppet_agent::Config]` -##### `msi_move_locked_files` +An array of configuration data to enforce. Each configuration data item must be a +Puppet_agent::Config hash, which has keys for puppet.conf section, setting, and value. +This parameter is constrained to managing only a predetermined set of configuration +settings, e.g. runinterval. -Data type: `Any` +Default value: `[]` +##### `proxy` +Data type: `Optional` -Default value: `false` +This is to be able to configure yum-repo with proxy, needed for -##### `wait_for_pxp_agent_exit` +Default value: `undef` -Data type: `Any` +##### `version_file_path` +Data type: `String` +The default install path for the VERSION file -Default value: `undef` +Default value: `$facts['os']['family'] ? { 'windows' => "${facts['env_windows_installdir']}\\VERSION", default => '/opt/puppetlabs/puppet/VERSION'` -##### `wait_for_puppet_run` +##### `skip_if_unavailable` -Data type: `Any` +Data type: `String` -Default value: `undef` +Default value: `'absent'` -##### `config` +##### `disable_proxy` -Data type: `Array[Puppet_agent::Config]` +Data type: `Boolean` -Default value: `[]` +Default value: `false` ### `puppet_agent::configure` -The puppet_agent::configure class. +puppet.conf, and will always be present. It does not require management of +the agent package. ### `puppet_agent::install` @@ -425,9 +389,6 @@ This class is called from puppet_agent for install. === Parameters -[version] - The puppet-agent version to install. - #### Parameters The following parameters are available in the `puppet_agent::install` class: @@ -438,25 +399,32 @@ The following parameters are available in the `puppet_agent::install` class: ##### `package_version` -Data type: `Any` - +Data type: `String` +The puppet-agent version to install. Default value: `'present'` ##### `install_dir` -Data type: `Any` - +Data type: `Optional` +The directory the puppet agent should be installed to. This is only applicable for +windows operating systems. Default value: `undef` ##### `install_options` -Data type: `Any` - +Data type: `Array` +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 +when passed to the install command. With Windows packages, note that file paths in an +install option must use backslashes. (Since install options are passed directly to +the installation command, forward slashes won't be automatically converted like they +are in `file` resources.) Note also that backslashes in double-quoted strings _must_ +be escaped and backslashes in single-quoted strings _can_ be escaped. Default value: `[]` @@ -468,6 +436,8 @@ Private class called from puppet_agent class Manage the install process for Darwin OSes specifically +=== Parameters + #### Parameters The following parameters are available in the `puppet_agent::install::darwin` class: @@ -477,15 +447,21 @@ The following parameters are available in the `puppet_agent::install::darwin` cl ##### `package_version` -Data type: `Any` - +Data type: `Optional` +The puppet-agent version to install. ##### `install_options` -Data type: `Any` - +Data type: `Array` +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 +when passed to the install command. With Windows packages, note that file paths in an +install option must use backslashes. (Since install options are passed directly to +the installation command, forward slashes won't be automatically converted like they +are in `file` resources.) Note also that backslashes in double-quoted strings _must_ +be escaped and backslashes in single-quoted strings _can_ be escaped. Default value: `[]` @@ -497,6 +473,8 @@ Private class called from puppet_agent class Manage the install process for solaris specifically +=== Parameters + #### Parameters The following parameters are available in the `puppet_agent::install::solaris` class: @@ -506,15 +484,21 @@ The following parameters are available in the `puppet_agent::install::solaris` c ##### `package_version` -Data type: `Any` - +Data type: `Optional` +The puppet-agent version to install. ##### `install_options` -Data type: `Any` - +Data type: `Array` +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 +when passed to the install command. With Windows packages, note that file paths in an +install option must use backslashes. (Since install options are passed directly to +the installation command, forward slashes won't be automatically converted like they +are in `file` resources.) Note also that backslashes in double-quoted strings _must_ +be escaped and backslashes in single-quoted strings _can_ be escaped. Default value: `[]` @@ -526,6 +510,8 @@ Private class called from puppet_agent class Manage the install process for SUSE OSes specifically +=== Parameters + #### Parameters The following parameters are available in the `puppet_agent::install::suse` class: @@ -535,15 +521,21 @@ The following parameters are available in the `puppet_agent::install::suse` clas ##### `package_version` -Data type: `Any` - +Data type: `Optional` +The puppet-agent version to install. ##### `install_options` -Data type: `Any` - +Data type: `Array` +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 +when passed to the install command. With Windows packages, note that file paths in an +install option must use backslashes. (Since install options are passed directly to +the installation command, forward slashes won't be automatically converted like they +are in `file` resources.) Note also that backslashes in double-quoted strings _must_ +be escaped and backslashes in single-quoted strings _can_ be escaped. Default value: `[]` @@ -555,56 +547,65 @@ Private class called from puppet_agent class Manage the install process for windows specifically +=== Parameters + #### Parameters The following parameters are available in the `puppet_agent::install::windows` class: -* [`install_dir`](#-puppet_agent--install--windows--install_dir) * [`install_options`](#-puppet_agent--install--windows--install_options) +* [`install_dir`](#-puppet_agent--install--windows--install_dir) -##### `install_dir` - -Data type: `Any` +##### `install_options` +Data type: `Array` +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 +when passed to the install command. With Windows packages, note that file paths in an +install option must use backslashes. (Since install options are passed directly to +the installation command, forward slashes won't be automatically converted like they +are in `file` resources.) Note also that backslashes in double-quoted strings _must_ +be escaped and backslashes in single-quoted strings _can_ be escaped. -Default value: `undef` - -##### `install_options` +Default value: `[]` -Data type: `Any` +##### `install_dir` +Data type: `Optional` +The directory the puppet agent should be installed to. This is only applicable for +windows operating systems. -Default value: `[]` +Default value: `undef` ### `puppet_agent::osfamily::aix` -The puppet_agent::osfamily::aix class. +location for AIX OSes ### `puppet_agent::osfamily::darwin` -The puppet_agent::osfamily::darwin class. +location for Darwin OSes ### `puppet_agent::osfamily::debian` -The puppet_agent::osfamily::debian class. +location for Debain OSes ### `puppet_agent::osfamily::redhat` -The puppet_agent::osfamily::redhat class. +location for RedHat OSes ### `puppet_agent::osfamily::solaris` -The puppet_agent::osfamily::solaris class. +location for Solaris OSes ### `puppet_agent::osfamily::suse` -The puppet_agent::osfamily::suse class. +location for SUSE OSes ### `puppet_agent::osfamily::windows` -The puppet_agent::osfamily::windows class. +location for Windows OSes ### `puppet_agent::params` @@ -621,9 +622,6 @@ This class is called from puppet_agent to prepare for the upgrade. === Parameters -[version] - The puppet-agent version to install. - #### Parameters The following parameters are available in the `puppet_agent::prepare` class: @@ -632,9 +630,9 @@ The following parameters are available in the `puppet_agent::prepare` class: ##### `package_version` -Data type: `Any` - +Data type: `Optional` +The puppet-agent version to install. Default value: `undef` @@ -646,8 +644,7 @@ The only job this class has is to ensure that the correct puppet-agent package is downloaded locally for installation. This is used on platforms without package managers capable of working with a remote https repository. -[package_file_name] - The puppet-agent package file to retrieve from the master. +=== Parameters #### Parameters @@ -657,7 +654,7 @@ The following parameters are available in the `puppet_agent::prepare::package` c ##### `source` -Data type: `Any` +Data type: `Optional` @@ -667,6 +664,8 @@ Data type: `Any` Private class called from puppet_agent::prepare class +=== Parameters + #### Parameters The following parameters are available in the `puppet_agent::prepare::puppet_config` class: @@ -675,9 +674,9 @@ The following parameters are available in the `puppet_agent::prepare::puppet_con ##### `package_version` -Data type: `Any` - +Data type: `Optional` +The puppet-agent version to install. ### `puppet_agent::service` @@ -763,73 +762,73 @@ Puppet will usually discover the appropriate provider for your platform. Type: Ruby 4.x API -The any_resources_of_type function. +Puppet::Parser::Resource instances of the passed in resource type #### `any_resources_of_type(String $resource_type, Optional[Hash[Any, Any]] $parameters)` -The any_resources_of_type function. +Puppet::Parser::Resource instances of the passed in resource type -Returns: `Any` +Returns: `Boolean` Whether there are any instances of resource_type ##### `resource_type` Data type: `String` - +Resource type that is being looked for ##### `parameters` Data type: `Optional[Hash[Any, Any]]` - +Optional parameters ### `uri_host_from_string` Type: Ruby 3.x API -Return a uri host from a string +The uri_host_from_string function. #### `uri_host_from_string()` -Return a uri host from a string +The uri_host_from_string function. -Returns: `Any` +Returns: `Any` Return a uri host from a string ### `windows_msi_installargs` Type: Ruby 3.x API -Return the $install_options parameter as a string usable in an msiexec command +The windows_msi_installargs function. #### `windows_msi_installargs()` -Return the $install_options parameter as a string usable in an msiexec command +The windows_msi_installargs function. -Returns: `Any` +Returns: `String` Return the $install_options parameter as a string usable in an msiexec command ### `windows_native_path` Type: Ruby 3.x API -Return a windows native path +The windows_native_path function. #### `windows_native_path()` -Return a windows native path +The windows_native_path function. -Returns: `Any` +Returns: `Any` Return a windows native path ## Data types ### `Puppet_agent::Arch` -The Puppet_agent::Arch data type. +This type stores all possible architecture patterns Alias of `Pattern[/^x86$/, /^x64$/, /^i386$/, /^i86pc$/, /^amd64$/, /^x86_64$/, /^power$/, /^sun4[uv]$/, /^ppc64le$/, /^aarch64$/, /PowerPC_POWER/]` ### `Puppet_agent::Config` -The Puppet_agent::Config data type. +This Puppet type alias Alias of @@ -847,7 +846,7 @@ Variant[Struct[{ section => Enum[main, server, agent, user, master], An enumerated list of settings which are permitted to be managed by this module. -Alias of `Enum[agent_catalog_run_lockfile, agent_disabled_lockfile, allow_duplicate_certs, always_retry_plugins, autoflush, autosign, basemodulepath, binder_config, bucketdir, ca_fingerprint, ca_name, ca_port, ca_server, ca_ttl, cacert, cacrl, cadir, cakey, capub, catalog_cache_terminus, catalog_terminus, cert_inventory, certdir, certificate_revocation, certname, ciphers, classfile, client_datadir, clientbucketdir, clientyamldir, code, codedir, color, confdir, config, config_file_name, config_version, configprint, crl_refresh_interval, csr_attributes, csrdir, daemonize, data_binding_terminus, default_file_terminus, default_manifest, default_schedules, deviceconfdir, deviceconfig, devicedir, diff, diff_args, digest_algorithm, disable_i18n, disable_per_environment_manifest, disable_warnings, dns_alt_names, document_all, environment, environment_data_provider, environment_timeout, environment_timeout_mode, environmentpath, evaltrace, external_nodes, fact_name_length_soft_limit, fact_value_length_soft_limit, facterng, factpath, facts_terminus, fileserverconfig, filetimeout, forge_authorization, freeze_main, func3x_check, future_features, genconfig, genmanifest, graph, graphdir, group, hiera_config, hostcert, hostcrl, hostcsr, hostprivkey, hostpubkey, http_connect_timeout, http_debug, http_extra_headers, http_keepalive_timeout, http_proxy_host, http_proxy_password, http_proxy_port, http_proxy_user, http_read_timeout, http_user_agent, ignore_plugin_errors, ignoremissingtypes, ignoreschedules, key_type, keylength, lastrunfile, lastrunreport, ldapattrs, ldapbase, ldapclassattrs, ldapparentattr, ldappassword, ldapport, ldapserver, ldapssl, ldapstackedattrs, ldapstring, ldaptls, ldapuser, libdir, localcacert, localedest, localesource, log_level, logdest, logdir, manage_internal_file_permissions, manifest, masterport, max_deprecations, max_errors, max_warnings, maximum_uid, maxwaitforcert, maxwaitforlock, merge_dependency_warnings, mkusers, module_groups, module_repository, module_working_dir, modulepath, name, named_curve, no_proxy, node_cache_terminus, node_name, node_name_fact, node_name_value, node_terminus, noop, number_of_facts_soft_limit, onetime, passfile, path, payload_soft_limit, pidfile, plugindest, pluginfactdest, pluginfactsource, pluginsignore, pluginsource, pluginsync, postrun_command, preferred_serialization_format, prerun_command, preview_outputdir, priority, privatedir, privatekeydir, profile, publickeydir, puppet_trace, puppetdlog, report, report_include_system_store, report_port, report_server, reportdir, reports, reporturl, requestdir, resourcefile, rest_authconfig, resubmit_facts, rich_data, route_file, rundir, runinterval, runtimeout, serial, server, server_datadir, server_list, serverport, show_diff, signeddir, skip_tags, sourceaddress, splay, splaylimit, srv_domain, ssl_client_ca_auth, ssl_client_header, ssl_client_verify_header, ssl_lockfile, ssl_server_ca_auth, ssl_trust_store, ssldir, statedir, statefile, statettl, static_catalogs, storeconfigs, storeconfigs_backend, strict, strict_environment_mode, strict_hostname_checking, strict_variables, summarize, supported_checksum_types, syslogfacility, tags, tasks, top_level_facts_soft_limit, trace, transactionstorefile, trusted_external_command, trusted_oid_mapping_file, use_cached_catalog, use_srv_records, usecacheonfailure, user, vardir, vendormoduledir, versioned_environment_dirs, waitforcert, waitforlock, yamldir]` +Alias of `Enum[agent_catalog_run_lockfile, agent_disabled_lockfile, allow_duplicate_certs, allow_pson_serialization, always_retry_plugins, autoflush, autosign, basemodulepath, binder_config, bucketdir, ca_fingerprint, ca_name, ca_port, ca_refresh_interval, ca_server, ca_ttl, cacert, cacrl, cadir, cakey, capub, catalog_cache_terminus, catalog_terminus, cert_inventory, certdir, certificate_revocation, certname, ciphers, classfile, client_datadir, clientbucketdir, clientyamldir, code, codedir, color, confdir, config, config_file_name, config_version, configprint, crl_refresh_interval, csr_attributes, csrdir, daemonize, data_binding_terminus, default_file_terminus, default_manifest, default_schedules, deviceconfdir, deviceconfig, devicedir, diff, diff_args, digest_algorithm, disable_i18n, disable_per_environment_manifest, disable_warnings, dns_alt_names, document_all, environment, environment_data_provider, environment_timeout, environment_timeout_mode, environmentpath, evaltrace, exclude_unchanged_resources, external_nodes, fact_name_length_soft_limit, fact_value_length_soft_limit, facterng, factpath, facts_terminus, fileserverconfig, filetimeout, forge_authorization, freeze_main, func3x_check, future_features, genconfig, genmanifest, graph, graphdir, group, hiera_config, hostcert, hostcert_renewal_interval, hostcrl, hostcsr, hostprivkey, hostpubkey, http_connect_timeout, http_debug, http_extra_headers, http_keepalive_timeout, http_proxy_host, http_proxy_password, http_proxy_port, http_proxy_user, http_read_timeout, http_user_agent, ignore_plugin_errors, ignoremissingtypes, ignoreschedules, include_legacy_facts, key_type, keylength, lastrunfile, lastrunreport, ldapattrs, ldapbase, ldapclassattrs, ldapparentattr, ldappassword, ldapport, ldapserver, ldapssl, ldapstackedattrs, ldapstring, ldaptls, ldapuser, libdir, localcacert, localedest, localesource, location_trusted, log_level, logdest, logdir, manage_internal_file_permissions, manifest, masterport, max_deprecations, max_errors, max_warnings, maximum_uid, maxwaitforcert, maxwaitforlock, merge_dependency_warnings, mkusers, module_groups, module_repository, module_working_dir, modulepath, name, named_curve, no_proxy, node_cache_terminus, node_name, node_name_fact, node_name_value, node_terminus, noop, number_of_facts_soft_limit, onetime, passfile, path, payload_soft_limit, pidfile, plugindest, pluginfactdest, pluginfactsource, pluginsignore, pluginsource, pluginsync, postrun_command, preferred_serialization_format, preprocess_deferred, prerun_command, preview_outputdir, priority, privatedir, privatekeydir, profile, publicdir, publickeydir, puppet_trace, puppetdlog, report, report_configured_environmentpath, report_include_system_store, report_port, report_server, reportdir, reports, reporturl, requestdir, resourcefile, rest_authconfig, resubmit_facts, rich_data, route_file, rundir, runinterval, runtimeout, serial, server, server_datadir, server_list, serverport, settings_catalog, show_diff, signeddir, skip_tags, sourceaddress, splay, splaylimit, srv_domain, ssl_client_ca_auth, ssl_client_header, ssl_client_verify_header, ssl_lockfile, ssl_server_ca_auth, ssl_trust_store, ssldir, statedir, statefile, statettl, static_catalogs, storeconfigs, storeconfigs_backend, strict, strict_environment_mode, strict_hostname_checking, strict_variables, summarize, supported_checksum_types, syslogfacility, tags, tasks, top_level_facts_soft_limit, trace, transactionstorefile, trusted_external_command, trusted_oid_mapping_file, use_cached_catalog, use_last_environment, use_srv_records, usecacheonfailure, user, vardir, vendormoduledir, versioned_environment_dirs, waitforcert, waitforlock, write_catalog_summary, yamldir]` ## Tasks diff --git a/Rakefile b/Rakefile index 2e2066eeb..fca2456c2 100644 --- a/Rakefile +++ b/Rakefile @@ -7,6 +7,10 @@ require 'puppet-syntax/tasks/puppet-syntax' require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any? +# puppet-lint-top_scope_facts assumes all top scope variables are facts. +# This configures the check to ignore all top scope variables listed in [] +PuppetLint.configuration.top_scope_variables = ['platform_tag'] + def changelog_user return unless Rake.application.top_level_tasks.include? "changelog" returnVal = nil || JSON.load(File.read('metadata.json'))['author'] diff --git a/docker/upgrade.pp b/docker/upgrade.pp index 300e61b95..eb1d52a16 100644 --- a/docker/upgrade.pp +++ b/docker/upgrade.pp @@ -1,5 +1,5 @@ node default { - class { '::puppet_agent': + class { 'puppet_agent': package_version => $facts['to_version'], # Upgrades in Docker cannot start the puppet service due to systemd # incompatibilities. Essentially, Docker expects an init system for diff --git a/examples/init.pp b/examples/init.pp index 6901f2c5b..fa7453707 100644 --- a/examples/init.pp +++ b/examples/init.pp @@ -9,4 +9,4 @@ # Learn more about module testing here: # http://docs.puppetlabs.com/guides/tests_smoke.html # -include ::puppet_agent +include puppet_agent diff --git a/lib/puppet/functions/any_resources_of_type.rb b/lib/puppet/functions/any_resources_of_type.rb index 4efa6503c..a9d0554d8 100644 --- a/lib/puppet/functions/any_resources_of_type.rb +++ b/lib/puppet/functions/any_resources_of_type.rb @@ -1,4 +1,9 @@ +# @summary A function used to determine if there are any +# Puppet::Parser::Resource instances of the passed in resource type Puppet::Functions.create_function(:any_resources_of_type, Puppet::Functions::InternalFunction) do + # @return [Boolean] Whether there are any instances of resource_type + # @param resource_type Resource type that is being looked for + # @param parameters Optional parameters dispatch :any_resources_of_type do scope_param diff --git a/lib/puppet/parser/functions/uri_host_from_string.rb b/lib/puppet/parser/functions/uri_host_from_string.rb index 78dfdcd4e..3f100ac17 100644 --- a/lib/puppet/parser/functions/uri_host_from_string.rb +++ b/lib/puppet/parser/functions/uri_host_from_string.rb @@ -2,7 +2,7 @@ module Puppet::Parser::Functions newfunction(:uri_host_from_string, arity: 1, type: :rvalue, doc: <<-EOS - Return a uri host from a string + @return Return a uri host from a string EOS ) do |args| uri = URI(args[0]) diff --git a/lib/puppet/parser/functions/windows_msi_installargs.rb b/lib/puppet/parser/functions/windows_msi_installargs.rb index 2160ff35a..6ca8e742e 100644 --- a/lib/puppet/parser/functions/windows_msi_installargs.rb +++ b/lib/puppet/parser/functions/windows_msi_installargs.rb @@ -1,6 +1,6 @@ module Puppet::Parser::Functions newfunction(:windows_msi_installargs, arity: 1, type: :rvalue, doc: <<-EOS - Return the $install_options parameter as a string usable in an msiexec command + @return [String] Return the $install_options parameter as a string usable in an msiexec command EOS ) do |args| install_args = args[0] diff --git a/lib/puppet/parser/functions/windows_native_path.rb b/lib/puppet/parser/functions/windows_native_path.rb index 3205729e2..0b0f490f1 100644 --- a/lib/puppet/parser/functions/windows_native_path.rb +++ b/lib/puppet/parser/functions/windows_native_path.rb @@ -1,6 +1,7 @@ module Puppet::Parser::Functions + # @return Windows native path newfunction(:windows_native_path, arity: 1, type: :rvalue, doc: <<-EOS - Return a windows native path + @return Return a windows native path EOS ) do |args| path = args[0] diff --git a/lib/puppet/provider/puppet_agent_end_run/puppet_agent_end_run.rb b/lib/puppet/provider/puppet_agent_end_run/puppet_agent_end_run.rb index 2df01c986..d49c1b096 100644 --- a/lib/puppet/provider/puppet_agent_end_run/puppet_agent_end_run.rb +++ b/lib/puppet/provider/puppet_agent_end_run/puppet_agent_end_run.rb @@ -1,4 +1,6 @@ + Puppet::Type.type(:puppet_agent_end_run).provide :puppet_agent_end_run do + desc '@summary This provider will stop the puppet agent run after a Puppet upgrade is performed' def end_run false end diff --git a/lib/puppet/provider/puppet_agent_upgrade_error/puppet_agent_upgrade_error.rb b/lib/puppet/provider/puppet_agent_upgrade_error/puppet_agent_upgrade_error.rb index 777d7b5ff..bf29fc0fb 100644 --- a/lib/puppet/provider/puppet_agent_upgrade_error/puppet_agent_upgrade_error.rb +++ b/lib/puppet/provider/puppet_agent_upgrade_error/puppet_agent_upgrade_error.rb @@ -1,4 +1,10 @@ Puppet::Type.type(:puppet_agent_upgrade_error).provide :puppet_agent_upgrade_error do + desc <<-DESC + @summary This provider checks an error log from a previous puppet agent + installation and will fail if the error log exists. The provider will delete + the existing error log before failing so that after the failed puppet run the + user can attempt the upgrade again. + DESC def ensure_notexist logfile = File.join(Puppet['statedir'].to_s, @resource[:name]) Puppet.debug "Checking for Error logfile #{logfile}" diff --git a/manifests/configure.pp b/manifests/configure.pp index e55f7a782..41f7a1081 100644 --- a/manifests/configure.pp +++ b/manifests/configure.pp @@ -1,3 +1,6 @@ +# @summary This class uses $puppet_agent::config to manage settings in +# puppet.conf, and will always be present. It does not require management of +# the agent package. class puppet_agent::configure { assert_private() diff --git a/manifests/init.pp b/manifests/init.pp index 66140dabd..26ed3f66a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,76 +4,76 @@ # # === Parameters # -# [arch] +# @param arch # The package architecture. Defaults to the architecture fact. -# [collection] +# @param collection # The Puppet Collection to track. Defaults to 'PC1'. -# [is_pe] +# @param is_pe # Install from Puppet Enterprise repos. Enabled if communicating with a PE master. -# [manage_pki_dir] +# @param manage_pki_dir # Whether or not to manage the /etc/pki directory. Defaults to true. # Managing the /etc/pki directory inside the puppet_agent module can be problematic for # organizations that manage gpg keys and settings in other modules. -# [manage_repo] +# @param manage_repo # Boolean to determine whether to configure repositories # This is intended to provide the ability to disable configuring a local repo # in support of systems that manage external repositories (i.e. spacewalk/satellite) # to enable users to add the proper packages to their internal repos # and to utilize default package providers for the install -# [package_name] +# @param package_name # The package to upgrade to, i.e. `puppet-agent`. -# [package_version] +# @param package_version # The package version to upgrade to. Explicitly specify the version to upgrade to, # or set to 'auto' to specify the version of the compiling master. -# [service_names] +# @param service_names # An array of services to start, normally `puppet`. # None will be started if the array is empty. -# [source] +# @param source # **INCLUDED FOR COMPATIBILITY WITH MODULE VERSIONS 1.0/2.0. PREFER USE OF "absolute_source", # "apt_source", "deb_source" etc. OVER USE OF "source".** # # The location to find packages. Replaces base URL for unix/MacOS agents, used as fully # qualified path in windows -# [absolute_source] +# @param absolute_source # The exact location of the package to install. The entire path to the package must be # provided with this parameter. -# [yum_source] +# @param yum_source # Base URL of the location of mirrors of yum.puppet.com downloads sites. Directories under # the URL "yum_source" should match the structure of the yum.puppet.com -# [apt_source] +# @param apt_source # Base URL of the location of mirrors of apt.puppet.com downloads sites. Directories under # the URL "apt_source" should match the structure of the apt.puppet.com -# [mac_source] +# @param mac_source # Base URL of the location of mirrors of downloads.puppet.com downloads site that serves # MacOS packages. Directories under the URL "mac_source" should match the structure of the # downloads.puppet.com site -# [windows_source] +# @param windows_source # Base URL of the location of mirrors of downloads.puppet.com downloads site that serves # Windows packages. Directories under the URL "windows_source" should match the structure of # the downloads.puppet.com site -# [solaris_source] +# @param solaris_source # Base URL of the location of a mirror for Solaris packages. Currently, solaris packages can # only be made available by using puppetlabs-pe_repo. This means the mirror must be of a # PE master package serve. -# [aix_source] +# @param aix_source # Base URL of the location of a mirror for AIX packages. Currently, AIX packages can # only be made available by using puppetlabs-pe_repo. This means the mirror must be of a # PE master package serve. -# [use_alternate_sources] +# @param use_alternate_sources # **ONLY APPLICABLE WHEN WORKING WITH PE INSTALLTIONS** # When set to true will force downloads to come from the values of $apt_source, $deb_source # $mac_source etc. rather than from the default PE master package serve. Note that this will # also force downloads to ignore alternate_pe_source -# [alternate_pe_source] +# @param alternate_pe_source # Base URL of the location where packages are located in the same structure that's served # by a PE master (the directory structure in PE for serving packages is created by the # puppetlabs-pe_repo module). The general structure served by PE is: # /packages/${pe_server_version}/${platform_tag}/${package_name} -# [install_dir] +# @param install_dir # The directory the puppet agent should be installed to. This is only applicable for # windows operating systems. This only applies when upgrading the agent to a new # version; it will not cause re-installation of the same version to a new location. -# [install_options] +# @param install_options # 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 # when passed to the install command. With Windows packages, note that file paths in an @@ -81,53 +81,61 @@ # the installation command, forward slashes won't be automatically converted like they # are in `file` resources.) Note also that backslashes in double-quoted strings _must_ # be escaped and backslashes in single-quoted strings _can_ be escaped. -# [msi_move_locked_files] +# @param msi_move_locked_files # This is only applicable for Windows operating systems. There may be instances where # file locks cause unncessary service restarts. By setting to true, the module # will move files prior to installation that are known to cause file locks. -# [wait_for_pxp_agent_exit] +# @param wait_for_pxp_agent_exit # This parameter is only applicable for Windows operating systems and pertains to the # /files/install_agent.ps1 script. This parameterizes the module to define the wait time # for the PXP agent to end successfully. The default value is set 2 minutes. -# [wait_for_puppet_run] +# @param wait_for_puppet_run # This parameter is only applicable for Windows operating systems and pertains to the # /files/install_agent.ps1 script. This parameterizes the module to define the wait time # for the current puppet agent run to end successfully. The default value is set 2 minutes. -# [config] +# @param config # An array of configuration data to enforce. Each configuration data item must be a # Puppet_agent::Config hash, which has keys for puppet.conf section, setting, and value. # 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 +# provided by puppetserver. +# @param version_file_path +# The default install path for the VERSION file +# @param skip_if_unavailable +# @param disable_proxy class puppet_agent ( - $arch = $facts['os']['architecture'], - $collection = $::puppet_agent::params::collection, - $is_pe = $::puppet_agent::params::_is_pe, - $manage_pki_dir = true, - $manage_repo = true, - $package_name = 'puppet-agent', - $package_version = undef, - $service_names = $::puppet_agent::params::service_names, - $source = undef, - $absolute_source = undef, - $yum_source = 'http://yum.puppet.com', - $apt_source = 'https://apt.puppet.com', - $mac_source = 'https://downloads.puppet.com', - $windows_source = 'https://downloads.puppet.com', - $solaris_source = 'puppet:///pe_packages', - $aix_source = 'puppet:///pe_packages', - $use_alternate_sources = false, - $alternate_pe_source = undef, - Optional[Stdlib::Absolutepath] $install_dir = undef, - $disable_proxy = false, - $proxy = undef, - $install_options = [], - $skip_if_unavailable = 'absent', - $msi_move_locked_files = false, - $wait_for_pxp_agent_exit = undef, - $wait_for_puppet_run = undef, - Array[Puppet_agent::Config] $config = [], - $version_file_path = $facts['os']['family'] ? { 'windows' => "${facts['env_windows_installdir']}\\VERSION", default => '/opt/puppetlabs/puppet/VERSION' } -) inherits ::puppet_agent::params { + String $arch = $facts['os']['architecture'], + String $collection = $puppet_agent::params::collection, + Boolean $is_pe = $puppet_agent::params::_is_pe, + Boolean $manage_pki_dir = true, + Boolean $manage_repo = true, + String $package_name = 'puppet-agent', + Optional $package_version = undef, + Array $service_names = $puppet_agent::params::service_names, + Optional $source = undef, + Optional $absolute_source = undef, + String $yum_source = 'http://yum.puppet.com', + String $apt_source = 'https://apt.puppet.com', + String $mac_source = 'https://downloads.puppet.com', + String $windows_source = 'https://downloads.puppet.com', + String $solaris_source = 'puppet:///modules/pe_packages', + String $aix_source = 'puppet:///modules/pe_packages', + Boolean $use_alternate_sources = false, + Optional $alternate_pe_source = undef, + Optional[Stdlib::Absolutepath] $install_dir = undef, + Boolean $disable_proxy = false, + Optional $proxy = undef, + Array $install_options = [], + 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' } +) 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 # the agent package. Dependencies for configure will be declared later if the @@ -193,14 +201,14 @@ $aio_upgrade_required = false $aio_downgrade_required = false } else { - $aio_upgrade_required = versioncmp($::aio_agent_version, $_expected_package_version) < 0 - $aio_downgrade_required = versioncmp($::aio_agent_version, $_expected_package_version) > 0 + $aio_upgrade_required = versioncmp($facts['aio_agent_version'], $_expected_package_version) < 0 + $aio_downgrade_required = versioncmp($facts['aio_agent_version'], $_expected_package_version) > 0 } if $aio_upgrade_required { if any_resources_of_type('filebucket', { path => false }) { - if $settings::digest_algorithm != $::puppet_digest_algorithm { - fail("Remote filebuckets are enabled, but there was a agent/server digest algorithm mismatch. Server: ${settings::digest_algorithm}, agent: ${::puppet_digest_algorithm}. Either ensure the algorithms are matching, or disable remote filebuckets during the upgrade.") + if $settings::digest_algorithm != $facts['puppet_digest_algorithm'] { + fail("Remote filebuckets are enabled, but there was a agent/server digest algorithm mismatch. Server: ${settings::digest_algorithm}, agent: ${facts['puppet_digest_algorithm']}. Either ensure the algorithms are matching, or disable remote filebuckets during the upgrade.") } } } @@ -214,10 +222,10 @@ $_package_version = $master_or_package_version } - class { '::puppet_agent::prepare': + class { 'puppet_agent::prepare': package_version => $_package_version, } - class { '::puppet_agent::install': + class { 'puppet_agent::install': package_version => $_package_version, install_dir => $install_dir, install_options => $install_options, @@ -232,7 +240,7 @@ # - On Windows, services are handled by the puppet-agent MSI packages themselves. # ...but outside of PE, on other platforms, we must make sure the services are restarted. We do that with the # ::puppet_agent::service class. Make sure it's applied after the install process finishes if needed: - if $facts['os']['family'] != 'windows' and (!$is_pe or versioncmp($::clientversion, '4.0.0') < 0) { + if $facts['os']['family'] != 'windows' and (!$is_pe or versioncmp($facts['clientversion'], '4.0.0') < 0) { Class['puppet_agent::configure'] ~> contain('puppet_agent::service') } diff --git a/manifests/install.pp b/manifests/install.pp index 0d80aedf3..e0e9ffccc 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -4,13 +4,23 @@ # # === Parameters # -# [version] +# @param package_version # The puppet-agent version to install. -# +# @param install_dir +# The directory the puppet agent should be installed to. This is only applicable for +# windows operating systems. +# @param install_options +# 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 +# when passed to the install command. With Windows packages, note that file paths in an +# install option must use backslashes. (Since install options are passed directly to +# the installation command, forward slashes won't be automatically converted like they +# 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 ( - $package_version = 'present', - $install_dir = undef, - $install_options = [], + String $package_version = 'present', + Optional $install_dir = undef, + Array $install_options = [], ) { assert_private() @@ -22,7 +32,7 @@ package_version => $package_version, install_options => $install_options, } - contain '::puppet_agent::install::solaris' + contain 'puppet_agent::install::solaris' } elsif $facts['os']['name'] == 'Darwin' { # Prevent re-running the script install if $puppet_agent::aio_upgrade_required { @@ -30,7 +40,7 @@ package_version => $package_version, install_options => $install_options, } - contain '::puppet_agent::install::darwin' + contain 'puppet_agent::install::darwin' } } elsif $facts['os']['family'] == 'windows' { # Prevent re-running the batch install @@ -39,7 +49,7 @@ install_dir => $install_dir, install_options => $install_options, } - contain '::puppet_agent::install::windows' + contain 'puppet_agent::install::windows' } } elsif $facts['os']['family'] == 'suse' { # Prevent re-running the batch install @@ -48,7 +58,7 @@ package_version => $package_version, install_options => $install_options, } - contain '::puppet_agent::install::suse' + contain 'puppet_agent::install::suse' } } else { if $facts['os']['name'] == 'AIX' { @@ -56,15 +66,15 @@ $_package_version = $package_version $_install_options = concat(['--ignoreos'],$install_options) $_provider = 'rpm' - $_source = "${::puppet_agent::params::local_packages_dir}/${::puppet_agent::prepare::package::package_file_name}" + $_source = "${puppet_agent::params::local_packages_dir}/${puppet_agent::prepare::package::package_file_name}" } elsif $facts['os']['family'] == 'Debian' { $_install_options = $install_options - if $::puppet_agent::absolute_source { + if $puppet_agent::absolute_source { # absolute_source means we use dpkg on debian based platforms $_package_version = 'present' $_provider = 'dpkg' # The source package should have been downloaded by puppet_agent::prepare::package to the local_packages_dir - $_source = "${::puppet_agent::params::local_packages_dir}/${::puppet_agent::prepare::package::package_file_name}" + $_source = "${puppet_agent::params::local_packages_dir}/${puppet_agent::prepare::package::package_file_name}" } else { # any other type of source means we use apt with no 'source' defined in the package resource below if $package_version =~ /^latest$|^present$/ { @@ -77,12 +87,12 @@ } } else { # RPM platforms: EL $_install_options = $install_options - if $::puppet_agent::absolute_source { + if $puppet_agent::absolute_source { # absolute_source means we use rpm on EL based platforms $_package_version = $package_version $_provider = 'rpm' # The source package should have been downloaded by puppet_agent::prepare::package to the local_packages_dir - $_source = "${::puppet_agent::params::local_packages_dir}/${::puppet_agent::prepare::package::package_file_name}" + $_source = "${puppet_agent::params::local_packages_dir}/${puppet_agent::prepare::package::package_file_name}" } else { # any other type of source means we use a package manager (yum) with no 'source' parameter in the # package resource below @@ -92,7 +102,7 @@ } } $_aio_package_version = $package_version.match(/^\d+\.\d+\.\d+(\.\d+)?|^latest$|^present$/)[0] - package { $::puppet_agent::package_name: + package { $puppet_agent::package_name: ensure => $_package_version, install_options => $_install_options, provider => $_provider, diff --git a/manifests/install/darwin.pp b/manifests/install/darwin.pp index 1ec48df02..c02ebde54 100644 --- a/manifests/install/darwin.pp +++ b/manifests/install/darwin.pp @@ -4,23 +4,35 @@ # # Manage the install process for Darwin OSes specifically # +# === Parameters +# +# @param package_version +# The puppet-agent version to install. +# @param install_options +# 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 +# when passed to the install command. With Windows packages, note that file paths in an +# install option must use backslashes. (Since install options are passed directly to +# the installation command, forward slashes won't be automatically converted like they +# 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 ( - $package_version, - $install_options = [], + Optional $package_version, + Array $install_options = [], ) { assert_private() $install_script = 'osx_install.sh.erb' - $_logfile = "${::env_temp_variable}/osx_install.log" + $_logfile = "${facts['env_temp_variable']}/osx_install.log" notice("Puppet install log file at ${_logfile}") - $_installsh = "${::env_temp_variable}/osx_install.sh" + $_installsh = "${facts['env_temp_variable']}/osx_install.sh" file { $_installsh: ensure => file, mode => '0755', - content => template('puppet_agent/do_install.sh.erb') + content => template('puppet_agent/do_install.sh.erb'), } -> exec { 'osx_install script': - command => "${_installsh} ${::puppet_agent_pid} 2>&1 > ${_logfile} &", + command => "${_installsh} ${facts['env_temp_variable']} 2>&1 > ${_logfile} &", } } diff --git a/manifests/install/solaris.pp b/manifests/install/solaris.pp index acd137bb2..d34fc9633 100644 --- a/manifests/install/solaris.pp +++ b/manifests/install/solaris.pp @@ -4,20 +4,32 @@ # # Manage the install process for solaris specifically # +# === Parameters +# +# @param package_version +# The puppet-agent version to install. +# @param install_options +# 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 +# when passed to the install command. With Windows packages, note that file paths in an +# install option must use backslashes. (Since install options are passed directly to +# the installation command, forward slashes won't be automatically converted like they +# 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 ( - $package_version, - $install_options = [], + Optional $package_version, + Array $install_options = [], ) { assert_private() if $facts['os']['release']['major'] == '10' { - $_unzipped_package_name = regsubst($::puppet_agent::prepare::package::package_file_name, '\.gz$', '') + $_unzipped_package_name = regsubst($puppet_agent::prepare::package::package_file_name, '\.gz$', '') $install_script = 'solaris_install.sh.erb' # The following are expected to be available in the solaris_install.sh.erb template: $adminfile = '/opt/puppetlabs/packages/solaris-noask' $sourcefile = "/opt/puppetlabs/packages/${_unzipped_package_name}" - $service_names = $::puppet_agent::service_names + $service_names = $puppet_agent::service_names # Puppet prior to 5.0 would not use a separate process contract when forking from the Puppet # service. That resulted in service-initiated upgrades failing because trying to remove or @@ -26,23 +38,23 @@ # Puppet 5.0 adds this, but some i18n implementation is loading code fairly late and appears # to be messing up the upgrade. - if $::puppet_agent::aio_upgrade_required { - $_logfile = "${::env_temp_variable}/solaris_install.log" + if $puppet_agent::aio_upgrade_required { + $_logfile = "${facts['env_temp_variable']}/solaris_install.log" notice ("Puppet install log file at ${_logfile}") - $_installsh = "${::env_temp_variable}/solaris_install.sh" + $_installsh = "${facts['env_temp_variable']}/solaris_install.sh" file { $_installsh: ensure => file, mode => '0755', - content => template('puppet_agent/do_install.sh.erb') + content => template('puppet_agent/do_install.sh.erb'), } -> exec { 'solaris_install script': - command => "/usr/bin/ctrun -l none ${_installsh} ${::puppet_agent_pid} 2>&1 > ${_logfile} &", + command => "/usr/bin/ctrun -l none ${_installsh} ${facts['puppet_agent_pid']} 2>&1 > ${_logfile} &", } } } else { $_aio_package_version = $package_version.match(/^\d+\.\d+\.\d+(\.\d+)?/)[0] - package { $::puppet_agent::package_name: + package { $puppet_agent::package_name: ensure => $package_version, install_options => $install_options, notify => Puppet_agent_end_run[$_aio_package_version], diff --git a/manifests/install/suse.pp b/manifests/install/suse.pp index 36764757e..0f4d04331 100644 --- a/manifests/install/suse.pp +++ b/manifests/install/suse.pp @@ -4,22 +4,34 @@ # # Manage the install process for SUSE OSes specifically # +# === Parameters +# +# @param package_version +# The puppet-agent version to install. +# @param install_options +# 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 +# when passed to the install command. With Windows packages, note that file paths in an +# install option must use backslashes. (Since install options are passed directly to +# the installation command, forward slashes won't be automatically converted like they +# 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::suse ( - $package_version, - $install_options = [], + Optional $package_version, + Array $install_options = [], ) { assert_private() - if ($::puppet_agent::absolute_source) or ($facts['os']['release']['major'] == '11' and $::puppet_agent::is_pe) { + if ($puppet_agent::absolute_source) or ($facts['os']['release']['major'] == '11' and $puppet_agent::is_pe) { $_provider = 'rpm' - $_source = "${::puppet_agent::params::local_packages_dir}/${::puppet_agent::prepare::package::package_file_name}" + $_source = "${puppet_agent::params::local_packages_dir}/${puppet_agent::prepare::package::package_file_name}" exec { 'GPG check the RPM file': path => '/bin:/usr/bin:/sbin:/usr/sbin', command => "rpm -K ${_source}", require => File[$_source], logoutput => 'on_failure', - notify => Package[$::puppet_agent::package_name], + notify => Package[$puppet_agent::package_name], } } else { $_provider = 'zypper' @@ -27,7 +39,7 @@ } $_aio_package_version = $package_version.match(/^\d+\.\d+\.\d+(\.\d+)?|^latest$|^present$/)[0] - package { $::puppet_agent::package_name: + package { $puppet_agent::package_name: ensure => $package_version, install_options => $install_options, provider => $_provider, diff --git a/manifests/install/windows.pp b/manifests/install/windows.pp index 2ce15964b..c89708b27 100644 --- a/manifests/install/windows.pp +++ b/manifests/install/windows.pp @@ -4,30 +4,43 @@ # # Manage the install process for windows specifically # +# === Parameters +# +# @param install_options +# 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 +# when passed to the install command. With Windows packages, note that file paths in an +# install option must use backslashes. (Since install options are passed directly to +# the installation command, forward slashes won't be automatically converted like they +# are in `file` resources.) Note also that backslashes in double-quoted strings _must_ +# be escaped and backslashes in single-quoted strings _can_ be escaped. +# @param install_dir +# The directory the puppet agent should be installed to. This is only applicable for +# windows operating systems. class puppet_agent::install::windows ( - $install_dir = undef, - $install_options = [], - ) { + Optional $install_dir = undef, + Array $install_options = [], +) { assert_private() - $service_names = $::puppet_agent::service_names + $service_names = $puppet_agent::service_names - $_msi_location = $::puppet_agent::prepare::package::local_package_file_path + $_msi_location = $puppet_agent::prepare::package::local_package_file_path $_install_options = $install_options ? { [] => windows_msi_installargs(['REINSTALLMODE="amus"']), default => windows_msi_installargs($install_options) } - if (member($::puppet_agent::service_names, 'puppet')) { + if (member($puppet_agent::service_names, 'puppet')) { $_agent_startup_mode = 'Automatic' } else { $_agent_startup_mode = undef } - if $::puppet_agent::msi_move_locked_files { - if ($::puppet_agent::_expected_package_version.match(/^5.5/) and versioncmp($::puppet_agent::_expected_package_version, '5.5.17') < 0) or - ($::puppet_agent::_expected_package_version.match(/^6/) and versioncmp($::puppet_agent::_expected_package_version, '6.8.0') < 0) { + if $puppet_agent::msi_move_locked_files { + if ($puppet_agent::_expected_package_version.match(/^5.5/) and versioncmp($puppet_agent::_expected_package_version, '5.5.17') < 0) or + ($puppet_agent::_expected_package_version.match(/^6/) and versioncmp($puppet_agent::_expected_package_version, '6.8.0') < 0) { $_move_dll_workaround = '-UseLockedFilesWorkaround' } else { notify { 'Ignoring msi_move_locked_files setting as it is no longer needed with newer puppet-agent versions (puppet 5 >= 5.5.17 or puppet 6 >= 6.8.0)': } @@ -37,43 +50,44 @@ $_move_dll_workaround = undef } - if $::puppet_agent::wait_for_pxp_agent_exit { + if $puppet_agent::wait_for_pxp_agent_exit { $_pxp_agent_wait = "-WaitForPXPAgentExit ${puppet_agent::wait_for_pxp_agent_exit}" } else { $_pxp_agent_wait = undef } - if $::puppet_agent::wait_for_puppet_run { + if $puppet_agent::wait_for_puppet_run { $_puppet_run_wait = "-WaitForPuppetRun ${puppet_agent::wait_for_puppet_run}" } else { $_puppet_run_wait = undef } $_timestamp = strftime('%Y_%m_%d-%H_%M') - $_logfile = windows_native_path("${::env_temp_variable}/puppet-${_timestamp}-installer.log") + $_logfile = windows_native_path("${facts['env_temp_variable']}/puppet-${_timestamp}-installer.log") notice ("Puppet upgrade log file at ${_logfile}") debug ("Installing puppet from ${_msi_location}") - $_helpers = windows_native_path("${::env_temp_variable}/helpers.ps1") + $_helpers = windows_native_path("${facts['env_temp_variable']}/helpers.ps1") file { $_helpers: ensure => file, - content => file('puppet_agent/helpers.ps1') + content => file('puppet_agent/helpers.ps1'), } - $_installps1 = windows_native_path("${::env_temp_variable}/install_puppet.ps1") + $_installps1 = windows_native_path("${facts['env_temp_variable']}/install_puppet.ps1") puppet_agent_upgrade_error { 'puppet_agent_upgrade_failure.log': } file { $_installps1: ensure => file, - content => file('puppet_agent/install_puppet.ps1') + content => file('puppet_agent/install_puppet.ps1'), } - $_prerequisites_check = windows_native_path("${::env_temp_variable}/prerequisites_check.ps1") + $_prerequisites_check = windows_native_path("${facts['env_temp_variable']}/prerequisites_check.ps1") file { $_prerequisites_check: ensure => file, - content => file('puppet_agent/prerequisites_check.ps1') + content => file('puppet_agent/prerequisites_check.ps1'), } +# lint:ignore:top_scope_facts exec { 'prerequisites_check.ps1': command => "${facts['os']['windows']['system32']}\\WindowsPowerShell\\v1.0\\powershell.exe \ -ExecutionPolicy Bypass \ @@ -81,7 +95,7 @@ -NoLogo \ -NonInteractive \ ${_prerequisites_check} ${::puppet_agent::_expected_package_version} ${_msi_location} ${_logfile}", - require => File[$_prerequisites_check] + require => File[$_prerequisites_check], } exec { 'install_puppet.ps1': @@ -94,11 +108,11 @@ -NoLogo \ -NonInteractive \ -Command ${_installps1} \ - -PuppetPID ${::puppet_agent_pid} \ + -PuppetPID ${facts['puppet_agent_pid']} \ -Source '${_msi_location}' \ -Logfile '${_logfile}' \ -InstallDir '${install_dir}' \ - -PuppetMaster '${::puppet_master_server}' \ + -PuppetMaster '${facts['puppet_master_server']}' \ -PuppetStartType '${_agent_startup_mode}' \ -InstallArgs '${_install_options}' \ ${_move_dll_workaround} \ @@ -114,18 +128,19 @@ exit 0; \ } \ exit 1; }.Invoke()", - path => $::path, + path => $facts['path'], require => [ Puppet_agent_upgrade_error['puppet_agent_upgrade_failure.log'], File[$_installps1], - Exec['prerequisites_check.ps1'] - ] + Exec['prerequisites_check.ps1'], + ], } +# lint:endignore # PUP-5480/PE-15037 Cache dir loses inheritable SYSTEM perms exec { 'fix inheritable SYSTEM perms': - command => "${facts['os']['windows']['system32']}\\icacls.exe \"${::puppet_client_datadir}\" /grant \"SYSTEM:(OI)(CI)(F)\"", - unless => "${facts['os']['windows']['system32']}\\cmd.exe /c ${facts['os']['windows']['system32']}\\icacls.exe \"${::puppet_client_datadir}\" | findstr \"SYSTEM:(OI)(CI)(F)\"", + command => "${facts['os']['windows']['system32']}\\icacls.exe \"${facts['puppet_client_datadir']}\" /grant \"SYSTEM:(OI)(CI)(F)\"", + unless => "${facts['os']['windows']['system32']}\\cmd.exe /c ${facts['os']['windows']['system32']}\\icacls.exe \"${facts['puppet_client_datadir']}\" | findstr \"SYSTEM:(OI)(CI)(F)\"", require => Exec['install_puppet.ps1'], } } diff --git a/manifests/osfamily/aix.pp b/manifests/osfamily/aix.pp index 5cc22b241..d4c5a358a 100644 --- a/manifests/osfamily/aix.pp +++ b/manifests/osfamily/aix.pp @@ -1,3 +1,5 @@ +# @summary This private class is used to determine the puppet-agent package +# location for AIX OSes class puppet_agent::osfamily::aix { assert_private() @@ -5,7 +7,7 @@ fail("${facts['os']['name']} not supported") } - if $::puppet_agent::is_pe != true { + if $puppet_agent::is_pe != true { fail('AIX upgrades are only supported on Puppet Enterprise') } @@ -34,30 +36,30 @@ # on puppet collection, package version and AIX version. $_aix_ver_number = regsubst($::platform_tag,'aix-(\d+\.\d+)-power','\1') if $_aix_ver_number { - if $::puppet_agent::collection =~ /^puppet8/ { + if $puppet_agent::collection =~ /^puppet8/ { $aix_ver_number = '7.2' - } elsif $::puppet_agent::collection =~ /^puppet7/ { + } elsif $puppet_agent::collection =~ /^puppet7/ { $aix_ver_number = '7.1' } else { # 6.19.1 is the last puppet6 release that ships AIX 6.1 packages - $aix_ver_number = versioncmp($::puppet_agent::prepare::package_version, '6.19.1') ? { + $aix_ver_number = versioncmp($puppet_agent::prepare::package_version, '6.19.1') ? { 1 => '7.1', default => '6.1' } } } - if $::puppet_agent::absolute_source { - $source = $::puppet_agent::absolute_source - } elsif $::puppet_agent::alternate_pe_source { - $source = "${::puppet_agent::alternate_pe_source}/packages/${pe_server_version}/aix-${aix_ver_number}-power/${::puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.aix${aix_ver_number}.ppc.rpm" - } elsif $::puppet_agent::source { - $source = "${::puppet_agent::source}/packages/${pe_server_version}/aix-${aix_ver_number}-power/${::puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.aix${aix_ver_number}.ppc.rpm" + if $puppet_agent::absolute_source { + $source = $puppet_agent::absolute_source + } elsif $puppet_agent::alternate_pe_source { + $source = "${puppet_agent::alternate_pe_source}/packages/${pe_server_version}/aix-${aix_ver_number}-power/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-1.aix${aix_ver_number}.ppc.rpm" + } elsif $puppet_agent::source { + $source = "${puppet_agent::source}/packages/${pe_server_version}/aix-${aix_ver_number}-power/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-1.aix${aix_ver_number}.ppc.rpm" } else { - $source = "${::puppet_agent::aix_source}/${pe_server_version}/aix-${aix_ver_number}-power/${::puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.aix${aix_ver_number}.ppc.rpm" + $source = "${puppet_agent::aix_source}/${pe_server_version}/aix-${aix_ver_number}-power/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-1.aix${aix_ver_number}.ppc.rpm" } - class { '::puppet_agent::prepare::package': + class { 'puppet_agent::prepare::package': source => $source, } contain puppet_agent::prepare::package diff --git a/manifests/osfamily/darwin.pp b/manifests/osfamily/darwin.pp index db9895901..95bb19be9 100644 --- a/manifests/osfamily/darwin.pp +++ b/manifests/osfamily/darwin.pp @@ -1,3 +1,5 @@ +# @summary This private class is used to determine the puppet-agent package +# location for Darwin OSes class puppet_agent::osfamily::darwin { assert_private() @@ -8,22 +10,22 @@ $productversion_major = $productversion_array[0] } - if $::puppet_agent::absolute_source { - $source = $::puppet_agent::absolute_source - } elsif ($::puppet_agent::is_pe and (!$::puppet_agent::use_alternate_sources)) { + if $puppet_agent::absolute_source { + $source = $puppet_agent::absolute_source + } elsif ($puppet_agent::is_pe and (!$puppet_agent::use_alternate_sources)) { $pe_server_version = pe_build_version() - if $::puppet_agent::alternate_pe_source { - $source = "${::puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}/${puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.osx${$productversion_major}.dmg" - } elsif $::puppet_agent::source { - $source = "${::puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}/${puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.osx${$productversion_major}.dmg" + if $puppet_agent::alternate_pe_source { + $source = "${puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-1.osx${$productversion_major}.dmg" + } elsif $puppet_agent::source { + $source = "${puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-1.osx${$productversion_major}.dmg" } else { - $source = "puppet:///pe_packages/${pe_server_version}/${::platform_tag}/${puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.osx${$productversion_major}.dmg" + $source = "puppet:///modules/pe_packages/${pe_server_version}/${::platform_tag}/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-1.osx${$productversion_major}.dmg" } } else { - $source = "${::puppet_agent::mac_source}/mac/${::puppet_agent::collection}/${productversion_major}/${::puppet_agent::arch}/${puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.osx${$productversion_major}.dmg" + $source = "${puppet_agent::mac_source}/mac/${puppet_agent::collection}/${productversion_major}/${puppet_agent::arch}/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-1.osx${$productversion_major}.dmg" } - class { '::puppet_agent::prepare::package': + class { 'puppet_agent::prepare::package': source => $source, } diff --git a/manifests/osfamily/debian.pp b/manifests/osfamily/debian.pp index 67fdeb1dc..4bfe1e509 100644 --- a/manifests/osfamily/debian.pp +++ b/manifests/osfamily/debian.pp @@ -1,26 +1,28 @@ +# @summary This private class is used to determine the puppet-agent package +# location for Debain OSes class puppet_agent::osfamily::debian { assert_private() - if $::puppet_agent::absolute_source { + if $puppet_agent::absolute_source { # Absolute sources are expected to be actual packages (not repos) # so when absolute_source is set just download the package to the # system and finish with this class. - $source = $::puppet_agent::absolute_source - class { '::puppet_agent::prepare::package': + $source = $puppet_agent::absolute_source + class { 'puppet_agent::prepare::package': source => $source, } contain puppet_agent::prepare::package } else { if getvar('::puppet_agent::manage_repo') == true { - include ::apt - if ($::puppet_agent::is_pe and (!$::puppet_agent::use_alternate_sources)) { + include apt + if ($puppet_agent::is_pe and (!$puppet_agent::use_alternate_sources)) { $pe_server_version = pe_build_version() - if $::puppet_agent::source { - $source = "${::puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}" - } elsif $::puppet_agent::alternate_pe_source { - $source = "${::puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}" + if $puppet_agent::source { + $source = "${puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}" + } elsif $puppet_agent::alternate_pe_source { + $source = "${puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}" } else { - $source = "https://${::puppet_master_server}:8140/packages/${pe_server_version}/${::platform_tag}" + $source = "https://${facts['puppet_master_server']}:8140/packages/${pe_server_version}/${::platform_tag}" } # In Puppet Enterprise, agent packages are served by the same server # as the master, which can be using either a self signed CA, or an external CA. @@ -28,10 +30,10 @@ # to be configured to pass in the agents certificates. By the time this code is called, # the module has already moved the certs to $ssl_dir/{certs,private_keys}, which # happen to be the default in PE already. - $_ssl_dir = $::puppet_agent::params::ssldir + $_ssl_dir = $puppet_agent::params::ssldir $_sslcacert_path = "${_ssl_dir}/certs/ca.pem" - $_sslclientcert_path = "${_ssl_dir}/certs/${::clientcert}.pem" - $_sslclientkey_path = "${_ssl_dir}/private_keys/${::clientcert}.pem" + $_sslclientcert_path = "${_ssl_dir}/certs/${facts['clientcert']}.pem" + $_sslclientkey_path = "${_ssl_dir}/private_keys/${facts['clientcert']}.pem" # For debian based platforms, in order to add SSL verification, you need to add a # configuration file specific to just the sources host @@ -45,7 +47,7 @@ $_apt_settings = concat( $_ca_cert_verification, - $_proxy_host) + $_proxy_host) apt::setting { 'conf-pc_repo': content => $_apt_settings.join(''), @@ -68,7 +70,7 @@ content => '', } } else { - $source = $::puppet_agent::apt_source + $source = $puppet_agent::apt_source } $legacy_keyname = 'GPG-KEY-puppet' $legacy_gpg_path = "/etc/pki/deb-gpg/${legacy_keyname}" @@ -82,7 +84,7 @@ } file { $legacy_gpg_path: - ensure => present, + ensure => file, owner => 0, group => 0, mode => '0644', @@ -95,7 +97,7 @@ } file { $gpg_path: - ensure => present, + ensure => file, owner => 0, group => 0, mode => '0644', @@ -104,7 +106,7 @@ apt::source { 'pc_repo': location => $source, - repos => $::puppet_agent::collection, + repos => $puppet_agent::collection, key => { 'id' => 'D6811ED3ADEEB8441AF5AA8F4528B6CD9E61EF26', 'source' => $gpg_path, @@ -115,7 +117,7 @@ # apt_update doesn't inherit the future class dependency, so it # can wait until the end of the run to exec. Force it to happen now. exec { 'pc_repo_force': - command => "/bin/echo 'forcing apt update for pc_repo ${::puppet_agent::collection}'", + command => "/bin/echo 'forcing apt update for pc_repo ${puppet_agent::collection}'", refreshonly => true, logoutput => true, subscribe => Exec['apt_update'], diff --git a/manifests/osfamily/redhat.pp b/manifests/osfamily/redhat.pp index 5f9d1917e..c530fadb3 100644 --- a/manifests/osfamily/redhat.pp +++ b/manifests/osfamily/redhat.pp @@ -1,16 +1,19 @@ +# @summary This private class is used to determine the puppet-agent package +# location for RedHat OSes class puppet_agent::osfamily::redhat { assert_private() - if $::puppet_agent::absolute_source { + if $puppet_agent::absolute_source { # Absolute sources are expected to be actual packages (not repos) # so when absolute_source is set just download the package to the # system and finish with this class. - $source = $::puppet_agent::absolute_source - class { '::puppet_agent::prepare::package': + $source = $puppet_agent::absolute_source + class { 'puppet_agent::prepare::package': source => $source, } contain puppet_agent::prepare::package } else { + # lint:ignore:only_variable_string case $facts['os']['name'] { 'Fedora': { $platform_and_version = "fedora/${facts['os']['release']['major']}" @@ -27,29 +30,30 @@ $platform_and_version = "el/${facts['os']['release']['major']}" } } - if ($::puppet_agent::is_pe and (!$::puppet_agent::use_alternate_sources)) { + # lint:endignore + if ($puppet_agent::is_pe and (!$puppet_agent::use_alternate_sources)) { $pe_server_version = pe_build_version() # Treat Amazon Linux just like Enterprise Linux $pe_repo_dir = ($facts['os']['name'] == 'Amazon') ? { true => "el-${amz_el_version}-${facts['os']['architecture']}", default => $::platform_tag, } - if $::puppet_agent::source { - $source = "${::puppet_agent::source}/packages/${pe_server_version}/${pe_repo_dir}" - } elsif $::puppet_agent::alternate_pe_source { - $source = "${::puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${pe_repo_dir}" + if $puppet_agent::source { + $source = "${puppet_agent::source}/packages/${pe_server_version}/${pe_repo_dir}" + } elsif $puppet_agent::alternate_pe_source { + $source = "${puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${pe_repo_dir}" } else { - $source = "https://${::puppet_master_server}:8140/packages/${pe_server_version}/${pe_repo_dir}" + $source = "https://${facts['puppet_master_server']}:8140/packages/${pe_server_version}/${pe_repo_dir}" } } else { - if $::puppet_agent::collection == 'PC1' { - $source = "${::puppet_agent::yum_source}/${platform_and_version}/${::puppet_agent::collection}/${::puppet_agent::arch}" + if $puppet_agent::collection == 'PC1' { + $source = "${puppet_agent::yum_source}/${platform_and_version}/${puppet_agent::collection}/${puppet_agent::arch}" } else { - $source = "${::puppet_agent::yum_source}/${::puppet_agent::collection}/${platform_and_version}/${::puppet_agent::arch}" + $source = "${puppet_agent::yum_source}/${puppet_agent::collection}/${platform_and_version}/${puppet_agent::arch}" } } - if ($::puppet_agent::is_pe and (!$::puppet_agent::use_alternate_sources)) { + if ($puppet_agent::is_pe and (!$puppet_agent::use_alternate_sources)) { # In Puppet Enterprise, agent packages are served by the same server # as the master, which can be using either a self signed CA, or an external CA. # In order for yum to authenticate to the yumrepo on the PE Master, it will need @@ -57,10 +61,10 @@ # the module has already moved the certs to $ssl_dir/{certs,private_keys}, which # happen to be the default in PE already. - $_ssl_dir = $::puppet_agent::params::ssldir + $_ssl_dir = $puppet_agent::params::ssldir $_sslcacert_path = "${_ssl_dir}/certs/ca.pem" - $_sslclientcert_path = "${_ssl_dir}/certs/${::clientcert}.pem" - $_sslclientkey_path = "${_ssl_dir}/private_keys/${::clientcert}.pem" + $_sslclientcert_path = "${_ssl_dir}/certs/${facts['clientcert']}.pem" + $_sslclientkey_path = "${_ssl_dir}/private_keys/${facts['clientcert']}.pem" # Due to the file paths changing on the PE Master, the 3.8 repository is no longer valid. # On upgrade, remove the repo file so that a dangling reference is not left behind returning # a 404 on subsequent runs. @@ -74,6 +78,7 @@ $_sslclientkey_path = undef } +# lint:ignore:strict_indent $legacy_keyname = 'GPG-KEY-puppet' $legacy_gpg_path = "/etc/pki/rpm-gpg/RPM-${legacy_keyname}" $keyname = 'GPG-KEY-puppet-20250406' @@ -103,15 +108,16 @@ rpm --import "${GPG_KEY_PATH}" fi | SCRIPT +# lint:endignore - if $::puppet_agent::manage_pki_dir == true { + if $puppet_agent::manage_pki_dir == true { file { ['/etc/pki', '/etc/pki/rpm-gpg']: ensure => directory, } } file { $legacy_gpg_path: - ensure => present, + ensure => file, owner => 0, group => 0, mode => '0644', @@ -119,7 +125,7 @@ } file { $gpg_path: - ensure => present, + ensure => file, owner => 0, group => 0, mode => '0644', @@ -141,14 +147,14 @@ logoutput => 'on_failure', } - if $::puppet_agent::manage_repo == true { - $_proxy = $::puppet_agent::disable_proxy ? { + if $puppet_agent::manage_repo == true { + $_proxy = $puppet_agent::disable_proxy ? { true => '_none_', - default => $::puppet_agent::proxy, + default => $puppet_agent::proxy, } yumrepo { 'pc_repo': baseurl => $source, - descr => "Puppet Labs ${::puppet_agent::collection} Repository", + descr => "Puppet Labs ${puppet_agent::collection} Repository", enabled => true, gpgcheck => '1', gpgkey => $gpg_keys, @@ -156,7 +162,7 @@ sslcacert => $_sslcacert_path, sslclientcert => $_sslclientcert_path, sslclientkey => $_sslclientkey_path, - skip_if_unavailable => $::puppet_agent::skip_if_unavailable, + skip_if_unavailable => $puppet_agent::skip_if_unavailable, } } } diff --git a/manifests/osfamily/solaris.pp b/manifests/osfamily/solaris.pp index dd45cb365..a4236cbf3 100644 --- a/manifests/osfamily/solaris.pp +++ b/manifests/osfamily/solaris.pp @@ -1,3 +1,5 @@ +# @summary This private class is used to determine the puppet-agent package +# location for Solaris OSes class puppet_agent::osfamily::solaris { assert_private() @@ -5,35 +7,35 @@ fail("${facts['os']['name']} not supported") } - if $::puppet_agent::is_pe != true { + if $puppet_agent::is_pe != true { fail('Solaris upgrades are only supported on Puppet Enterprise') } $pe_server_version = pe_build_version() - if $::puppet_agent::absolute_source { - $source_dir = $::puppet_agent::absolute_source - } elsif $::puppet_agent::alternate_pe_source { - $source_dir = "${::puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}" - } elsif $::puppet_agent::source { - $source_dir = "${::puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}" + if $puppet_agent::absolute_source { + $source_dir = $puppet_agent::absolute_source + } elsif $puppet_agent::alternate_pe_source { + $source_dir = "${puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}" + } elsif $puppet_agent::source { + $source_dir = "${puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}" } else { - $source_dir = "${::puppet_agent::solaris_source}/${pe_server_version}/${::platform_tag}" + $source_dir = "${puppet_agent::solaris_source}/${pe_server_version}/${::platform_tag}" } - $pkg_arch = $::puppet_agent::arch ? { + $pkg_arch = $puppet_agent::arch ? { /^sun4[uv]$/ => 'sparc', default => 'i386', } case $facts['os']['release']['major'] { '10': { - $package_file_name = "${::puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.${pkg_arch}.pkg.gz" - if $::puppet_agent::absolute_source { + $package_file_name = "${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-1.${pkg_arch}.pkg.gz" + if $puppet_agent::absolute_source { $source = $source_dir } else { $source = "${source_dir}/${package_file_name}" } - class { '::puppet_agent::prepare::package': + class { 'puppet_agent::prepare::package': source => $source, } contain puppet_agent::prepare::package @@ -48,22 +50,22 @@ } file { '/opt/puppetlabs/packages/solaris-noask': - ensure => present, + ensure => file, owner => 0, group => 0, mode => '0644', - source => "puppet:///pe_packages/${pe_server_version}/${::platform_tag}/solaris-noask", + source => "puppet:///modules/pe_packages/${pe_server_version}/${::platform_tag}/solaris-noask", } } '11': { - if $::puppet_agent::manage_repo { - $package_file_name = "${::puppet_agent::package_name}@${::puppet_agent::prepare::package_version},5.11-1.${pkg_arch}.p5p" - if $::puppet_agent::absolute_source { + if $puppet_agent::manage_repo { + $package_file_name = "${puppet_agent::package_name}@${puppet_agent::prepare::package_version},5.11-1.${pkg_arch}.p5p" + if $puppet_agent::absolute_source { $source = $source_dir } else { $source = "${source_dir}/${package_file_name}" } - class { '::puppet_agent::prepare::package': + class { 'puppet_agent::prepare::package': source => $source, } contain puppet_agent::prepare::package diff --git a/manifests/osfamily/suse.pp b/manifests/osfamily/suse.pp index 15049504b..841c4a8e6 100644 --- a/manifests/osfamily/suse.pp +++ b/manifests/osfamily/suse.pp @@ -1,3 +1,5 @@ +# @summary This private class is used to determine the puppet-agent package +# location for SUSE OSes class puppet_agent::osfamily::suse { assert_private() @@ -5,27 +7,27 @@ fail("${facts['os']['name']} not supported") } - if $::puppet_agent::absolute_source { + if $puppet_agent::absolute_source { # Absolute sources are expected to be actual packages (not repos) # so when absolute_source is set just download the package to the # system and finish with this class. - $source = $::puppet_agent::absolute_source - class { '::puppet_agent::prepare::package': + $source = $puppet_agent::absolute_source + class { 'puppet_agent::prepare::package': source => $source, } contain puppet_agent::prepare::package } else { - if ($::puppet_agent::is_pe and (!$::puppet_agent::use_alternate_sources)) { + if ($puppet_agent::is_pe and (!$puppet_agent::use_alternate_sources)) { $pe_server_version = pe_build_version() # SLES 11 in PE can no longer install agents from pe_repo if $facts['os']['release']['major'] == '11' { - if $::puppet_agent::source { - $source = "${::puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}" - } elsif $::puppet_agent::alternate_pe_source { - $source = "${::puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}" + if $puppet_agent::source { + $source = "${puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}" + } elsif $puppet_agent::alternate_pe_source { + $source = "${puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}" } else { - $source = "puppet:///pe_packages/${pe_server_version}/${::platform_tag}/${::puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-1.sles11.${::puppet_agent::arch}.rpm" + $source = "puppet:///modules/pe_packages/${pe_server_version}/${::platform_tag}/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-1.sles11.${puppet_agent::arch}.rpm" } # Nuke the repo if it exists to ensure zypper doesn't remain broken @@ -33,27 +35,28 @@ ensure => absent, } - class { '::puppet_agent::prepare::package': + class { 'puppet_agent::prepare::package': source => $source, } contain puppet_agent::prepare::package } else { - if $::puppet_agent::source { - $source = "${::puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}" - } elsif $::puppet_agent::alternate_pe_source { - $source = "${::puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}" + if $puppet_agent::source { + $source = "${puppet_agent::source}/packages/${pe_server_version}/${::platform_tag}" + } elsif $puppet_agent::alternate_pe_source { + $source = "${puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${::platform_tag}" } else { - $source = "https://${::puppet_master_server}:8140/packages/${pe_server_version}/${::platform_tag}" + $source = "https://${facts['puppet_master_server']}:8140/packages/${pe_server_version}/${::platform_tag}" } } } else { - if $::puppet_agent::collection == 'PC1' { - $source = "${::puppet_agent::yum_source}/sles/${facts['os']['release']['major']}/${::puppet_agent::collection}/${::puppet_agent::arch}" + if $puppet_agent::collection == 'PC1' { + $source = "${puppet_agent::yum_source}/sles/${facts['os']['release']['major']}/${puppet_agent::collection}/${puppet_agent::arch}" } else { - $source = "${::puppet_agent::yum_source}/${::puppet_agent::collection}/sles/${facts['os']['release']['major']}/${::puppet_agent::arch}" + $source = "${puppet_agent::yum_source}/${puppet_agent::collection}/sles/${facts['os']['release']['major']}/${puppet_agent::arch}" } } +# lint:ignore:strict_indent case $facts['os']['release']['major'] { '11', '12', '15': { # Import the GPG key @@ -84,6 +87,7 @@ rpm --import "${GPG_KEY_PATH}" fi | SCRIPT +# lint:endignore if getvar('::puppet_agent::manage_pki_dir') == true { file { ['/etc/pki', '/etc/pki/rpm-gpg']: @@ -92,7 +96,7 @@ } file { $gpg_path: - ensure => present, + ensure => file, owner => 0, group => 0, mode => '0644', @@ -100,7 +104,7 @@ } file { $legacy_gpg_path: - ensure => present, + ensure => file, owner => 0, group => 0, mode => '0644', @@ -122,7 +126,7 @@ logoutput => 'on_failure', } - unless $facts['os']['release']['major'] == '11' and $::puppet_agent::is_pe { + unless $facts['os']['release']['major'] == '11' and $puppet_agent::is_pe { if getvar('::puppet_agent::manage_repo') == true { # Set up a zypper repository by creating a .repo file which mimics a ini file $repo_file = '/etc/zypp/repos.d/pc_repo.repo' diff --git a/manifests/osfamily/windows.pp b/manifests/osfamily/windows.pp index bf65766c8..7b0a85020 100644 --- a/manifests/osfamily/windows.pp +++ b/manifests/osfamily/windows.pp @@ -1,33 +1,35 @@ +# @summary This private class is used to determine the puppet-agent package +# location for Windows OSes class puppet_agent::osfamily::windows { assert_private() - if $::puppet_agent::absolute_source { - $source = $::puppet_agent::absolute_source - } elsif $::puppet_agent::source { - $source = $::puppet_agent::source - } elsif ($::puppet_agent::is_pe and (!$::puppet_agent::use_alternate_sources)) { + if $puppet_agent::absolute_source { + $source = $puppet_agent::absolute_source + } elsif $puppet_agent::source { + $source = $puppet_agent::source + } elsif ($puppet_agent::is_pe and (!$puppet_agent::use_alternate_sources)) { $pe_server_version = pe_build_version() - $tag = $::puppet_agent::arch ? { - 'x64' => $::fips_enabled ? { + $tag = $puppet_agent::arch ? { + 'x64' => $facts['fips_enabled'] ? { true => 'windowsfips-x86_64', default => 'windows-x86_64' }, 'x86' => 'windows-i386' } - if $::puppet_agent::alternate_pe_source { - $source = "${::puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${tag}/${::puppet_agent::package_name}-${::puppet_agent::arch}.msi" + if $puppet_agent::alternate_pe_source { + $source = "${puppet_agent::alternate_pe_source}/packages/${pe_server_version}/${tag}/${puppet_agent::package_name}-${puppet_agent::arch}.msi" } else { - $source = "puppet:///pe_packages/${pe_server_version}/${tag}/${::puppet_agent::package_name}-${::puppet_agent::arch}.msi" + $source = "puppet:///modules/pe_packages/${pe_server_version}/${tag}/${puppet_agent::package_name}-${puppet_agent::arch}.msi" } } else { - if $::puppet_agent::collection == 'PC1' { - $source = "${::puppet_agent::windows_source}/windows/${::puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-${::puppet_agent::arch}.msi" + if $puppet_agent::collection == 'PC1' { + $source = "${puppet_agent::windows_source}/windows/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-${puppet_agent::arch}.msi" } else { - $source = "${::puppet_agent::windows_source}/windows/${::puppet_agent::collection}/${::puppet_agent::package_name}-${::puppet_agent::prepare::package_version}-${::puppet_agent::arch}.msi" + $source = "${puppet_agent::windows_source}/windows/${puppet_agent::collection}/${puppet_agent::package_name}-${puppet_agent::prepare::package_version}-${puppet_agent::arch}.msi" } } - class { '::puppet_agent::prepare::package': + class { 'puppet_agent::prepare::package': source => $source, } diff --git a/manifests/params.pp b/manifests/params.pp index 8eb90ad3b..1b0bd5fd2 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -12,10 +12,10 @@ $service_names = ['puppet'] } if $facts['os']['family'] == 'windows' { - $local_puppet_dir = windows_native_path("${::puppet_agent_appdata}/Puppetlabs") + $local_puppet_dir = windows_native_path("${facts['puppet_agent_appdata']}/Puppetlabs") $local_packages_dir = windows_native_path("${local_puppet_dir}/packages") - $confdir = $::puppet_confdir + $confdir = $facts['puppet_confdir'] $puppetdirs = [regsubst($confdir,'\/etc\/','/code/')] $path_separator = ';' diff --git a/manifests/prepare.pp b/manifests/prepare.pp index 3e6b063c8..b17cfe821 100644 --- a/manifests/prepare.pp +++ b/manifests/prepare.pp @@ -4,11 +4,10 @@ # # === Parameters # -# [version] +# @param package_version # The puppet-agent version to install. -# class puppet_agent::prepare ( - $package_version = undef + Optional $package_version = undef ) { include puppet_agent::params $_windows_client = downcase($facts['os']['family']) == 'windows' @@ -16,8 +15,8 @@ # Manage /opt/puppetlabs for platforms. This is done before both config and prepare because, # on Windows, both can be in C:/ProgramData/Puppet Labs; doing it later creates a dependency # cycle. - if !defined(File[$::puppet_agent::params::local_puppet_dir]) { - file { $::puppet_agent::params::local_puppet_dir: + if !defined(File[$puppet_agent::params::local_puppet_dir]) { + file { $puppet_agent::params::local_puppet_dir: ensure => directory, } } diff --git a/manifests/prepare/package.pp b/manifests/prepare/package.pp index 9ffe76167..af093347b 100644 --- a/manifests/prepare/package.pp +++ b/manifests/prepare/package.pp @@ -4,15 +4,15 @@ # package is downloaded locally for installation. This is used on platforms # without package managers capable of working with a remote https repository. # -# [package_file_name] -# The puppet-agent package file to retrieve from the master. +# === Parameters # +# @param source class puppet_agent::prepare::package ( - $source, + Optional $source, ) { assert_private() - file { $::puppet_agent::params::local_packages_dir: + file { $puppet_agent::params::local_packages_dir: ensure => directory, } @@ -23,20 +23,20 @@ # what it was before and we can still pull off the filename. $package_file_name = basename(regsubst($source, "\\\\", '/', 'G')) if $facts['os']['family'] =~ /windows/ { - $local_package_file_path = windows_native_path("${::puppet_agent::params::local_packages_dir}/${package_file_name}") + $local_package_file_path = windows_native_path("${puppet_agent::params::local_packages_dir}/${package_file_name}") $mode = undef } else { - $local_package_file_path = "${::puppet_agent::params::local_packages_dir}/${package_file_name}" + $local_package_file_path = "${puppet_agent::params::local_packages_dir}/${package_file_name}" $mode = '0644' } file { $local_package_file_path: - ensure => present, - owner => $::puppet_agent::params::user, - group => $::puppet_agent::params::group, + 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 + require => File[$puppet_agent::params::local_packages_dir], + checksum => sha256lite, } } diff --git a/manifests/prepare/puppet_config.pp b/manifests/prepare/puppet_config.pp index 57183dbba..1694f6090 100644 --- a/manifests/prepare/puppet_config.pp +++ b/manifests/prepare/puppet_config.pp @@ -2,11 +2,15 @@ # # Private class called from puppet_agent::prepare class # +# === Parameters +# +# @param package_version +# The puppet-agent version to install. class puppet_agent::prepare::puppet_config ( - $package_version, + Optional $package_version, ) { assert_private() - $puppetconf = $::puppet_agent::params::config + $puppetconf = $puppet_agent::params::config if !defined(File[$puppetconf]) { file { $puppetconf: @@ -17,7 +21,7 @@ # (minimum agent package version) => (list of deprecated settings) $_deprecations = { '1.4.0' => ['pluginsync'], - '5.0.0' => ['app_management', 'ignorecache', 'configtimeout', 'trusted_server_facts'] + '5.0.0' => ['app_management', 'ignorecache', 'configtimeout', 'trusted_server_facts'], } $_pkg_version = getvar('package_version') diff --git a/manifests/service.pp b/manifests/service.pp index 22e197328..3f7f80e08 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -6,23 +6,23 @@ class puppet_agent::service { assert_private() - $_service_names = $::puppet_agent::service_names + $_service_names = $puppet_agent::service_names - if $facts['os']['name'] == 'Solaris' and $facts['os']['release']['major'] == '10' and versioncmp("${::clientversion}", '5.0.0') < 0 { + if $facts['os']['name'] == 'Solaris' and $facts['os']['release']['major'] == '10' and versioncmp($facts['clientversion'], '5.0.0') < 0 { # Skip managing service, upgrade script will handle it. } elsif $facts['os']['name'] == 'Solaris' and $facts['os']['release']['major'] == '11' and $puppet_agent::aio_upgrade_required { # Only use script if we just performed an upgrade. - $_logfile = "${::env_temp_variable}/solaris_start_puppet.log" + $_logfile = "${facts['env_temp_variable']}/solaris_start_puppet.log" # We'll need to pass the names of the services to start to the script $_service_names_arg = join($_service_names, ' ') notice ("Puppet service start log file at ${_logfile}") - file { "${::env_temp_variable}/solaris_start_puppet.sh": + file { "${facts['env_temp_variable']}/solaris_start_puppet.sh": ensure => file, source => 'puppet:///modules/puppet_agent/solaris_start_puppet.sh', mode => '0755', } -> exec { 'solaris_start_puppet.sh': - command => "${::env_temp_variable}/solaris_start_puppet.sh ${::puppet_agent_pid} ${_service_names_arg} 2>&1 > ${_logfile} &", + command => "${facts['env_temp_variable']}/solaris_start_puppet.sh ${facts['puppet_agent_pid']} ${_service_names_arg} 2>&1 > ${_logfile} &", path => '/usr/bin:/bin:/usr/sbin', } file { ['/var/opt/lib', '/var/opt/lib/pe-puppet', '/var/opt/lib/pe-puppet/state']: diff --git a/spec/classes/puppet_agent_osfamily_aix_spec.rb b/spec/classes/puppet_agent_osfamily_aix_spec.rb index 14814377a..04825aefa 100644 --- a/spec/classes/puppet_agent_osfamily_aix_spec.rb +++ b/spec/classes/puppet_agent_osfamily_aix_spec.rb @@ -24,7 +24,7 @@ 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" } - let(:source) { "puppet:///pe_packages/2000.0.0/#{tag}/#{rpmname}" } + let(:source) { "puppet:///modules/pe_packages/2000.0.0/#{tag}/#{rpmname}" } let(:facts) do common_facts.merge({ architecture: "PowerPC_POWER#{powerver}", diff --git a/spec/classes/puppet_agent_osfamily_darwin_spec.rb b/spec/classes/puppet_agent_osfamily_darwin_spec.rb index cc9c5f7f4..a478d81be 100644 --- a/spec/classes/puppet_agent_osfamily_darwin_spec.rb +++ b/spec/classes/puppet_agent_osfamily_darwin_spec.rb @@ -94,7 +94,7 @@ override_facts(facts, aio_agent_version: '1.10.99', is_pe: true, os: { macosx: { version: { major: '10.13', }, }, }, platform_tag: 'osx-10.13-x86_64', serverversion: '5.10.200') end - it { is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-5.10.200-1.osx10.13.dmg').with_source('puppet:///pe_packages/2000.0.0/osx-10.13-x86_64/puppet-agent-5.10.200-1.osx10.13.dmg') } + it { is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-5.10.200-1.osx10.13.dmg').with_source('puppet:///modules/pe_packages/2000.0.0/osx-10.13-x86_64/puppet-agent-5.10.200-1.osx10.13.dmg') } end describe 'when using package_version auto with macOS 11 (two numbers version productversion)' do @@ -107,7 +107,7 @@ override_facts(facts, aio_agent_version: '1.10.99', is_pe: true, os: { macosx: { version: { major: '11.2', }, }, }, platform_tag: 'osx-11-x86_64', serverversion: '5.10.200') end - it { is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-5.10.200-1.osx11.dmg').with_source('puppet:///pe_packages/2000.0.0/osx-11-x86_64/puppet-agent-5.10.200-1.osx11.dmg') } + it { is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-5.10.200-1.osx11.dmg').with_source('puppet:///modules/pe_packages/2000.0.0/osx-11-x86_64/puppet-agent-5.10.200-1.osx11.dmg') } end describe 'when using package_version auto with macOS 11 (one number version productversion)' do @@ -120,6 +120,6 @@ override_facts(facts, aio_agent_version: '1.10.99', is_pe: true, os: { macosx: { version: { major: '11', }, }, }, platform_tag: 'osx-11-x86_64', serverversion: '5.10.200') end - it { is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-5.10.200-1.osx11.dmg').with_source('puppet:///pe_packages/2000.0.0/osx-11-x86_64/puppet-agent-5.10.200-1.osx11.dmg') } + it { is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-5.10.200-1.osx11.dmg').with_source('puppet:///modules/pe_packages/2000.0.0/osx-11-x86_64/puppet-agent-5.10.200-1.osx11.dmg') } end end diff --git a/spec/classes/puppet_agent_osfamily_debian_spec.rb b/spec/classes/puppet_agent_osfamily_debian_spec.rb index d29431e9a..e6040363b 100644 --- a/spec/classes/puppet_agent_osfamily_debian_spec.rb +++ b/spec/classes/puppet_agent_osfamily_debian_spec.rb @@ -154,7 +154,7 @@ it { is_expected.to contain_file('/etc/pki/deb-gpg/GPG-KEY-puppet-20250406') .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'owner' => '0', 'group' => '0', 'mode' => '0644', @@ -165,7 +165,7 @@ it { is_expected.to contain_file('/etc/pki/deb-gpg/GPG-KEY-puppet') .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'owner' => '0', 'group' => '0', 'mode' => '0644', diff --git a/spec/classes/puppet_agent_osfamily_redhat_spec.rb b/spec/classes/puppet_agent_osfamily_redhat_spec.rb index b32a3f8a6..60a3409a4 100644 --- a/spec/classes/puppet_agent_osfamily_redhat_spec.rb +++ b/spec/classes/puppet_agent_osfamily_redhat_spec.rb @@ -83,7 +83,7 @@ end context 'with manage_pki_dir => false' do - let(:params) { { manage_pki_dir: 'false' } } + let(:params) { { manage_pki_dir: false } } ['/etc/pki', '/etc/pki/rpm-gpg'].each do |path| it { is_expected.not_to contain_file(path) } @@ -93,7 +93,7 @@ it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-20250406') .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'owner' => '0', 'group' => '0', 'mode' => '0644', @@ -104,7 +104,7 @@ it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-puppet') .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'owner' => '0', 'group' => '0', 'mode' => '0644', @@ -240,7 +240,7 @@ { manage_repo: true, package_version: package_version, - skip_if_unavailable: true, + skip_if_unavailable: 'true', } end @@ -293,7 +293,7 @@ it { is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-6.12.0.rpm') .with('path' => '/opt/puppetlabs/packages/puppet-agent-6.12.0.rpm') - .with('ensure' => 'present') + .with('ensure' => 'file') .with('owner' => '0') .with('group' => '0') .with('mode' => '0644') diff --git a/spec/classes/puppet_agent_osfamily_solaris_spec.rb b/spec/classes/puppet_agent_osfamily_solaris_spec.rb index bd6b4e7c4..fc243f44c 100644 --- a/spec/classes/puppet_agent_osfamily_solaris_spec.rb +++ b/spec/classes/puppet_agent_osfamily_solaris_spec.rb @@ -119,7 +119,7 @@ def install_script(ver, arch) it do is_expected.to contain_file("/opt/puppetlabs/packages/puppet-agent@#{sol11_package_version},5.11-1.i386.p5p") .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'source' => "http://fake-solaris-source.com/packages/2000.0.0/solaris-11-i386/puppet-agent@#{sol11_package_version},5.11-1.i386.p5p", }) end @@ -137,8 +137,8 @@ def install_script(ver, arch) it do is_expected.to contain_file("/opt/puppetlabs/packages/puppet-agent@#{sol11_package_version},5.11-1.i386.p5p") .with({ - 'ensure' => 'present', - 'source' => "puppet:///pe_packages/#{pe_version}/solaris-11-i386/puppet-agent@#{sol11_package_version},5.11-1.i386.p5p", + 'ensure' => 'file', + 'source' => "puppet:///modules/pe_packages/#{pe_version}/solaris-11-i386/puppet-agent@#{sol11_package_version},5.11-1.i386.p5p", }) end @@ -193,8 +193,8 @@ def install_script(ver, arch) it do is_expected.to contain_file("/opt/puppetlabs/packages/puppet-agent@#{sol11_package_version},5.11-1.sparc.p5p") .with({ - 'ensure' => 'present', - 'source' => "puppet:///pe_packages/#{pe_version}/solaris-11-sparc/puppet-agent@#{sol11_package_version},5.11-1.sparc.p5p", + 'ensure' => 'file', + 'source' => "puppet:///modules/pe_packages/#{pe_version}/solaris-11-sparc/puppet-agent@#{sol11_package_version},5.11-1.sparc.p5p", }) end @@ -252,7 +252,7 @@ def install_script(ver, arch) it do is_expected.to contain_file("/opt/puppetlabs/packages/puppet-agent-#{package_version}-1.i386.pkg.gz") .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'source' => "http://fake-solaris-source.com/packages/2000.0.0/solaris-10-i386/puppet-agent-#{package_version}-1.i386.pkg.gz", }) end @@ -270,12 +270,12 @@ def install_script(ver, arch) it do is_expected.to contain_file("/opt/puppetlabs/packages/puppet-agent-#{package_version}-1.i386.pkg.gz") .with({ - 'ensure' => 'present', - 'source' => "puppet:///pe_packages/#{pe_version}/solaris-10-i386/puppet-agent-#{package_version}-1.i386.pkg.gz" + 'ensure' => 'file', + 'source' => "puppet:///modules/pe_packages/#{pe_version}/solaris-10-i386/puppet-agent-#{package_version}-1.i386.pkg.gz" }) end - it { is_expected.to contain_file('/opt/puppetlabs/packages/solaris-noask').with_source("puppet:///pe_packages/#{pe_version}/solaris-10-i386/solaris-noask") } + it { is_expected.to contain_file('/opt/puppetlabs/packages/solaris-noask').with_source("puppet:///modules/pe_packages/#{pe_version}/solaris-10-i386/solaris-noask") } it do is_expected.to contain_exec("unzip puppet-agent-#{package_version}-1.i386.pkg.gz").with_command("gzip -d /opt/puppetlabs/packages/puppet-agent-#{package_version}-1.i386.pkg.gz") is_expected.to contain_exec("unzip puppet-agent-#{package_version}-1.i386.pkg.gz").with_creates("/opt/puppetlabs/packages/puppet-agent-#{package_version}-1.i386.pkg") @@ -318,12 +318,12 @@ def install_script(ver, arch) it do is_expected.to contain_file("/opt/puppetlabs/packages/puppet-agent-#{package_version}-1.sparc.pkg.gz") .with({ - 'ensure' => 'present', - 'source' => "puppet:///pe_packages/#{pe_version}/solaris-10-sparc/puppet-agent-#{package_version}-1.sparc.pkg.gz" + 'ensure' => 'file', + 'source' => "puppet:///modules/pe_packages/#{pe_version}/solaris-10-sparc/puppet-agent-#{package_version}-1.sparc.pkg.gz" }) end - it { is_expected.to contain_file('/opt/puppetlabs/packages/solaris-noask').with_source("puppet:///pe_packages/#{pe_version}/solaris-10-sparc/solaris-noask") } + it { is_expected.to contain_file('/opt/puppetlabs/packages/solaris-noask').with_source("puppet:///modules/pe_packages/#{pe_version}/solaris-10-sparc/solaris-noask") } it do is_expected.to contain_exec("unzip puppet-agent-#{package_version}-1.sparc.pkg.gz").with_command("gzip -d /opt/puppetlabs/packages/puppet-agent-#{package_version}-1.sparc.pkg.gz") is_expected.to contain_exec("unzip puppet-agent-#{package_version}-1.sparc.pkg.gz").with_creates("/opt/puppetlabs/packages/puppet-agent-#{package_version}-1.sparc.pkg") diff --git a/spec/classes/puppet_agent_osfamily_suse_spec.rb b/spec/classes/puppet_agent_osfamily_suse_spec.rb index 88e7a999d..96426dcc3 100644 --- a/spec/classes/puppet_agent_osfamily_suse_spec.rb +++ b/spec/classes/puppet_agent_osfamily_suse_spec.rb @@ -105,7 +105,7 @@ end context 'with manage_pki_dir => false' do - let(:params) { { manage_pki_dir: 'false' } } + let(:params) { { manage_pki_dir: false } } ['/etc/pki', '/etc/pki/rpm-gpg'].each do |path| it { is_expected.not_to contain_file(path) } @@ -117,7 +117,7 @@ it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-20250406') .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'owner' => '0', 'group' => '0', 'mode' => '0644', @@ -128,7 +128,7 @@ it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-puppet') .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'owner' => '0', 'group' => '0', 'mode' => '0644', @@ -244,7 +244,7 @@ end context 'with manage_pki_dir => false' do - let(:params) { { manage_pki_dir: 'false' } } + let(:params) { { manage_pki_dir: false } } ['/etc/pki', '/etc/pki/rpm-gpg'].each do |path| it { is_expected.not_to contain_file(path) } @@ -256,7 +256,7 @@ it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-puppet-20250406') .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'owner' => '0', 'group' => '0', 'mode' => '0644', @@ -267,7 +267,7 @@ it { is_expected.to contain_file('/etc/pki/rpm-gpg/RPM-GPG-KEY-puppet') .with({ - 'ensure' => 'present', + 'ensure' => 'file', 'owner' => '0', 'group' => '0', 'mode' => '0644', @@ -373,7 +373,7 @@ it { is_expected.to contain_file('/opt/puppetlabs/packages/puppet-agent-1.10.100-1.sles11.x86_64.rpm') .with( - source: 'puppet:///pe_packages/2000.0.0/sles-11-x86_64/puppet-agent-1.10.100-1.sles11.x86_64.rpm', + source: 'puppet:///modules/pe_packages/2000.0.0/sles-11-x86_64/puppet-agent-1.10.100-1.sles11.x86_64.rpm', ) } it { diff --git a/spec/classes/puppet_agent_osfamily_windows_spec.rb b/spec/classes/puppet_agent_osfamily_windows_spec.rb index a0f7a5a84..224cbd958 100644 --- a/spec/classes/puppet_agent_osfamily_windows_spec.rb +++ b/spec/classes/puppet_agent_osfamily_windows_spec.rb @@ -53,7 +53,7 @@ it { is_expected.to contain_file("#{appdata}\\Puppetlabs\\packages") } it { is_expected.to contain_file("#{appdata}\\Puppetlabs\\packages\\puppet-agent-#{arch}.msi").with( - 'source' => "puppet:///pe_packages/#{pe_version}/windows-#{tag}/puppet-agent-#{arch}.msi", + 'source' => "puppet:///modules/pe_packages/#{pe_version}/windows-#{tag}/puppet-agent-#{arch}.msi", ) } end @@ -91,7 +91,7 @@ it { is_expected.to contain_file("#{appdata}\\Puppetlabs\\packages") } it { is_expected.to contain_file("#{appdata}\\Puppetlabs\\packages\\puppet-agent-#{arch}.msi").with( - 'source' => "puppet:///pe_packages/#{pe_version}/windows-#{tag}/puppet-agent-#{arch}.msi", + 'source' => "puppet:///modules/pe_packages/#{pe_version}/windows-#{tag}/puppet-agent-#{arch}.msi", ) } end @@ -131,7 +131,7 @@ it { is_expected.to contain_file("#{appdata}\\Puppetlabs\\packages") } it do is_expected.to contain_file("#{appdata}\\Puppetlabs\\packages\\puppet-agent-#{arch}.msi").with( - 'source' => "puppet:///pe_packages/#{pe_version}/windowsfips-#{tag}/puppet-agent-#{arch}.msi", + 'source' => "puppet:///modules/pe_packages/#{pe_version}/windowsfips-#{tag}/puppet-agent-#{arch}.msi", ) end end diff --git a/types/arch.pp b/types/arch.pp index dbfddb202..a1c194001 100644 --- a/types/arch.pp +++ b/types/arch.pp @@ -1 +1,2 @@ +# @summary This type stores all possible architecture patterns type Puppet_agent::Arch = Pattern[/^x86$/,/^x64$/,/^i386$/,/^i86pc$/,/^amd64$/,/^x86_64$/,/^power$/,/^sun4[uv]$/, /^ppc64le$/, /^aarch64$/, /PowerPC_POWER/] diff --git a/types/config.pp b/types/config.pp index d9f5a227b..df547275e 100644 --- a/types/config.pp +++ b/types/config.pp @@ -1,3 +1,4 @@ +# @summary This Puppet type alias type Puppet_agent::Config = Variant[Struct[{ section => Enum[main, server, agent, user, master], setting => Puppet_agent::Config_setting, value => String,