|
1 |
| -# == Class: puppet_agent |
| 1 | +# @summary Upgrades Puppet 4 and newer to the requested version. |
2 | 2 | #
|
3 |
| -# Upgrades Puppet 4 and newer to the requested version. |
4 |
| -# |
5 |
| -# === Parameters |
6 |
| -# |
7 |
| -# [arch] |
| 3 | +# @param arch |
8 | 4 | # The package architecture. Defaults to the architecture fact.
|
9 |
| -# [collection] |
| 5 | +# @param collection |
10 | 6 | # The Puppet Collection to track. Defaults to 'PC1'.
|
11 |
| -# [is_pe] |
| 7 | +# @param is_pe |
12 | 8 | # Install from Puppet Enterprise repos. Enabled if communicating with a PE master.
|
13 |
| -# [manage_pki_dir] |
| 9 | +# @param manage_pki_dir |
14 | 10 | # Whether or not to manage the /etc/pki directory. Defaults to true.
|
15 | 11 | # Managing the /etc/pki directory inside the puppet_agent module can be problematic for
|
16 | 12 | # organizations that manage gpg keys and settings in other modules.
|
17 |
| -# [manage_repo] |
| 13 | +# @param manage_repo |
18 | 14 | # Boolean to determine whether to configure repositories
|
19 | 15 | # This is intended to provide the ability to disable configuring a local repo
|
20 | 16 | # in support of systems that manage external repositories (i.e. spacewalk/satellite)
|
21 | 17 | # to enable users to add the proper packages to their internal repos
|
22 | 18 | # and to utilize default package providers for the install
|
23 |
| -# [package_name] |
| 19 | +# @param package_name |
24 | 20 | # The package to upgrade to, i.e. `puppet-agent`.
|
25 |
| -# [package_version] |
| 21 | +# @param package_version |
26 | 22 | # The package version to upgrade to. Explicitly specify the version to upgrade to,
|
27 | 23 | # or set to 'auto' to specify the version of the compiling master.
|
28 |
| -# [service_names] |
| 24 | +# @param service_names |
29 | 25 | # An array of services to start, normally `puppet`.
|
30 | 26 | # None will be started if the array is empty.
|
31 |
| -# [source] |
| 27 | +# @param source |
32 | 28 | # **INCLUDED FOR COMPATIBILITY WITH MODULE VERSIONS 1.0/2.0. PREFER USE OF "absolute_source",
|
33 | 29 | # "apt_source", "deb_source" etc. OVER USE OF "source".**
|
34 | 30 | #
|
35 | 31 | # The location to find packages. Replaces base URL for unix/MacOS agents, used as fully
|
36 | 32 | # qualified path in windows
|
37 |
| -# [absolute_source] |
| 33 | +# @param absolute_source |
38 | 34 | # The exact location of the package to install. The entire path to the package must be
|
39 | 35 | # provided with this parameter.
|
40 |
| -# [yum_source] |
| 36 | +# @param yum_source |
41 | 37 | # Base URL of the location of mirrors of yum.puppet.com downloads sites. Directories under
|
42 | 38 | # the URL "yum_source" should match the structure of the yum.puppet.com
|
43 |
| -# [apt_source] |
| 39 | +# @param apt_source |
44 | 40 | # Base URL of the location of mirrors of apt.puppet.com downloads sites. Directories under
|
45 | 41 | # the URL "apt_source" should match the structure of the apt.puppet.com
|
46 |
| -# [mac_source] |
| 42 | +# @param mac_source |
47 | 43 | # Base URL of the location of mirrors of downloads.puppet.com downloads site that serves
|
48 | 44 | # MacOS packages. Directories under the URL "mac_source" should match the structure of the
|
49 | 45 | # downloads.puppet.com site
|
50 |
| -# [windows_source] |
| 46 | +# @param windows_source |
51 | 47 | # Base URL of the location of mirrors of downloads.puppet.com downloads site that serves
|
52 | 48 | # Windows packages. Directories under the URL "windows_source" should match the structure of
|
53 | 49 | # the downloads.puppet.com site
|
54 |
| -# [solaris_source] |
| 50 | +# @param solaris_source |
55 | 51 | # Base URL of the location of a mirror for Solaris packages. Currently, solaris packages can
|
56 | 52 | # only be made available by using puppetlabs-pe_repo. This means the mirror must be of a
|
57 | 53 | # PE master package serve.
|
58 |
| -# [aix_source] |
| 54 | +# @param aix_source |
59 | 55 | # Base URL of the location of a mirror for AIX packages. Currently, AIX packages can
|
60 | 56 | # only be made available by using puppetlabs-pe_repo. This means the mirror must be of a
|
61 | 57 | # PE master package serve.
|
62 |
| -# [use_alternate_sources] |
| 58 | +# @param use_alternate_sources |
63 | 59 | # **ONLY APPLICABLE WHEN WORKING WITH PE INSTALLTIONS**
|
64 | 60 | # When set to true will force downloads to come from the values of $apt_source, $deb_source
|
65 | 61 | # $mac_source etc. rather than from the default PE master package serve. Note that this will
|
66 | 62 | # also force downloads to ignore alternate_pe_source
|
67 |
| -# [alternate_pe_source] |
| 63 | +# @param alternate_pe_source |
68 | 64 | # Base URL of the location where packages are located in the same structure that's served
|
69 | 65 | # by a PE master (the directory structure in PE for serving packages is created by the
|
70 | 66 | # puppetlabs-pe_repo module). The general structure served by PE is:
|
71 | 67 | # /packages/${pe_server_version}/${platform_tag}/${package_name}
|
72 |
| -# [install_dir] |
| 68 | +# @param install_dir |
73 | 69 | # The directory the puppet agent should be installed to. This is only applicable for
|
74 | 70 | # windows operating systems. This only applies when upgrading the agent to a new
|
75 | 71 | # version; it will not cause re-installation of the same version to a new location.
|
76 |
| -# [install_options] |
| 72 | +# @param install_options |
77 | 73 | # An array of additional options to pass when installing puppet-agent. Each option in
|
78 | 74 | # the array can either be a string or a hash. Each option will automatically be quoted
|
79 | 75 | # when passed to the install command. With Windows packages, note that file paths in an
|
80 | 76 | # install option must use backslashes. (Since install options are passed directly to
|
81 | 77 | # the installation command, forward slashes won't be automatically converted like they
|
82 | 78 | # are in `file` resources.) Note also that backslashes in double-quoted strings _must_
|
83 | 79 | # be escaped and backslashes in single-quoted strings _can_ be escaped.
|
84 |
| -# [msi_move_locked_files] |
| 80 | +# @param msi_move_locked_files |
85 | 81 | # This is only applicable for Windows operating systems. There may be instances where
|
86 | 82 | # file locks cause unncessary service restarts. By setting to true, the module
|
87 | 83 | # will move files prior to installation that are known to cause file locks.
|
88 |
| -# [wait_for_pxp_agent_exit] |
| 84 | +# @param wait_for_pxp_agent_exit |
89 | 85 | # This parameter is only applicable for Windows operating systems and pertains to the
|
90 | 86 | # /files/install_agent.ps1 script. This parameterizes the module to define the wait time
|
91 | 87 | # for the PXP agent to end successfully. The default value is set 2 minutes.
|
92 |
| -# [wait_for_puppet_run] |
| 88 | +# @param wait_for_puppet_run |
93 | 89 | # This parameter is only applicable for Windows operating systems and pertains to the
|
94 | 90 | # /files/install_agent.ps1 script. This parameterizes the module to define the wait time
|
95 | 91 | # for the current puppet agent run to end successfully. The default value is set 2 minutes.
|
96 |
| -# [config] |
| 92 | +# @param config |
97 | 93 | # An array of configuration data to enforce. Each configuration data item must be a
|
98 | 94 | # Puppet_agent::Config hash, which has keys for puppet.conf section, setting, and value.
|
99 | 95 | # This parameter is constrained to managing only a predetermined set of configuration
|
100 | 96 | # settings, e.g. runinterval.
|
| 97 | +# @param proxy |
| 98 | +# This is to be able to configure yum-repo with proxy, needed for |
| 99 | +# example for clients in dmz:s that need to use proxy to reach the repo |
| 100 | +# provided by puppetserver. |
| 101 | +# @param version_file_path |
| 102 | +# The default install path for the VERSION file |
| 103 | +# @param skip_if_unavailable |
| 104 | +# @param disable_proxy |
101 | 105 | class puppet_agent (
|
102 |
| - $arch = $facts['os']['architecture'], |
103 |
| - $collection = $::puppet_agent::params::collection, |
104 |
| - $is_pe = $::puppet_agent::params::_is_pe, |
105 |
| - $manage_pki_dir = true, |
106 |
| - $manage_repo = true, |
107 |
| - $package_name = 'puppet-agent', |
108 |
| - $package_version = undef, |
109 |
| - $service_names = $::puppet_agent::params::service_names, |
110 |
| - $source = undef, |
111 |
| - $absolute_source = undef, |
112 |
| - $yum_source = 'http://yum.puppet.com', |
113 |
| - $apt_source = 'https://apt.puppet.com', |
114 |
| - $mac_source = 'https://downloads.puppet.com', |
115 |
| - $windows_source = 'https://downloads.puppet.com', |
116 |
| - $solaris_source = 'puppet:///pe_packages', |
117 |
| - $aix_source = 'puppet:///pe_packages', |
118 |
| - $use_alternate_sources = false, |
119 |
| - $alternate_pe_source = undef, |
120 |
| - Optional[Stdlib::Absolutepath] $install_dir = undef, |
121 |
| - $disable_proxy = false, |
122 |
| - $proxy = undef, |
123 |
| - $install_options = [], |
124 |
| - $skip_if_unavailable = 'absent', |
125 |
| - $msi_move_locked_files = false, |
126 |
| - $wait_for_pxp_agent_exit = undef, |
127 |
| - $wait_for_puppet_run = undef, |
128 |
| - Array[Puppet_agent::Config] $config = [], |
129 |
| - $version_file_path = $facts['os']['family'] ? { 'windows' => "${facts['env_windows_installdir']}\\VERSION", default => '/opt/puppetlabs/puppet/VERSION' } |
130 |
| -) inherits ::puppet_agent::params { |
| 106 | + String $arch = $facts['os']['architecture'], |
| 107 | + String $collection = $puppet_agent::params::collection, |
| 108 | + Boolean $is_pe = $puppet_agent::params::_is_pe, |
| 109 | + Boolean $manage_pki_dir = true, |
| 110 | + Boolean $manage_repo = true, |
| 111 | + String $package_name = 'puppet-agent', |
| 112 | + Optional $package_version = undef, |
| 113 | + Array $service_names = $puppet_agent::params::service_names, |
| 114 | + Optional $source = undef, |
| 115 | + Optional $absolute_source = undef, |
| 116 | + String $yum_source = 'http://yum.puppet.com', |
| 117 | + String $apt_source = 'https://apt.puppet.com', |
| 118 | + String $mac_source = 'https://downloads.puppet.com', |
| 119 | + String $windows_source = 'https://downloads.puppet.com', |
| 120 | + String $solaris_source = 'puppet:///modules/pe_packages', |
| 121 | + String $aix_source = 'puppet:///modules/pe_packages', |
| 122 | + Boolean $use_alternate_sources = false, |
| 123 | + Optional $alternate_pe_source = undef, |
| 124 | + Optional[Stdlib::Absolutepath] $install_dir = undef, |
| 125 | + Boolean $disable_proxy = false, |
| 126 | + Optional $proxy = undef, |
| 127 | + Array $install_options = [], |
| 128 | + String $skip_if_unavailable = 'absent', |
| 129 | + Boolean $msi_move_locked_files = false, |
| 130 | + Optional $wait_for_pxp_agent_exit = undef, |
| 131 | + Optional $wait_for_puppet_run = undef, |
| 132 | + Array[Puppet_agent::Config] $config = [], |
| 133 | + String $version_file_path = $facts['os']['family'] ? { 'windows' => "${facts['env_windows_installdir']}\\VERSION", default => '/opt/puppetlabs/puppet/VERSION' } |
| 134 | +) inherits puppet_agent::params { |
131 | 135 | # The configure class uses $puppet_agent::config to manage settings in
|
132 | 136 | # puppet.conf, and will always be present. It does not require management of
|
133 | 137 | # the agent package. Dependencies for configure will be declared later if the
|
|
0 commit comments