|
99 | 99 | # This parameter is constrained to managing only a predetermined set of configuration
|
100 | 100 | # settings, e.g. runinterval.
|
101 | 101 | class puppet_agent (
|
102 |
| - $arch = $::architecture, |
| 102 | + $arch = $facts['os']['architecture'], |
103 | 103 | $collection = $::puppet_agent::params::collection,
|
104 | 104 | $is_pe = $::puppet_agent::params::_is_pe,
|
105 | 105 | $manage_pki_dir = true,
|
|
139 | 139 | fail('The puppet_agent module does not support pre-Puppet 4 upgrades.')
|
140 | 140 | }
|
141 | 141 |
|
142 |
| - if $package_version == 'latest' and $::osfamily =~ /^(?i:windows|solaris|aix|darwin)$/ { |
143 |
| - fail("Setting package_version to 'latest' is not supported on ${::osfamily.capitalize()}") |
| 142 | + if $package_version == 'latest' and $facts['os']['family'] =~ /^(?i:windows|solaris|aix|darwin)$/ { |
| 143 | + fail("Setting package_version to 'latest' is not supported on ${$facts['os']['family'].capitalize()}") |
144 | 144 | }
|
145 | 145 |
|
146 | 146 | if $source != undef and $absolute_source != undef {
|
147 | 147 | fail('Only one of $source and $absolute_source can be set')
|
148 | 148 | }
|
149 | 149 |
|
150 |
| - if $::osfamily == 'windows' and $install_dir != undef { |
| 150 | + if $facts['os']['family'] == 'windows' and $install_dir != undef { |
151 | 151 | validate_absolute_path($install_dir)
|
152 | 152 | }
|
153 | 153 |
|
|
159 | 159 | # In this code-path, $package_version != undef AND we are not on a PE infrastructure
|
160 | 160 | # node since $::pe_server_version is not defined
|
161 | 161 |
|
162 |
| - if $::architecture == 'x86' and $arch == 'x64' { |
| 162 | + if $facts['os']['architecture'] == 'x86' and $arch == 'x64' { |
163 | 163 | fail('Unable to install x64 on a x86 system')
|
164 | 164 | }
|
165 | 165 |
|
|
171 | 171 | $master_or_package_version = $package_version
|
172 | 172 | }
|
173 | 173 |
|
174 |
| - if $::osfamily == 'redhat' { |
| 174 | + if $facts['os']['family'] == 'redhat' { |
175 | 175 | if $master_or_package_version !~ /^\d+\.\d+\.\d+.*$|^latest$|^present$/ {
|
176 | 176 | fail("invalid version ${master_or_package_version} requested")
|
177 | 177 | }
|
|
184 | 184 | # Strip git sha from dev builds
|
185 | 185 | if $master_or_package_version =~ /.g/ {
|
186 | 186 | $_expected_package_version = split($master_or_package_version, /[.-]g.*/)[0]
|
187 |
| - } elsif $::osfamily == 'redhat' { |
| 187 | + } elsif $facts['os']['family'] == 'redhat' { |
188 | 188 | $_expected_package_version = $master_or_package_version.match(/^\d+\.\d+\.\d+|^latest$|^present$/)[0]
|
189 | 189 | } else {
|
190 | 190 | $_expected_package_version = $master_or_package_version
|
|
209 | 209 | }
|
210 | 210 | }
|
211 | 211 |
|
212 |
| - if $::operatingsystem == 'Solaris' and $::operatingsystemmajrelease == '11' { |
| 212 | + if $facts['os']['name'] == 'Solaris' and $facts['os']['release']['major'] == '11' { |
213 | 213 | # Strip letters from development builds. Unique to Solaris 11 packaging.
|
214 | 214 | $_version_without_letters = regsubst($master_or_package_version, '[a-zA-Z]', '', 'G')
|
215 | 215 | $_version_without_orphan_dashes = regsubst($_version_without_letters, '(^-|-$)', '', 'G')
|
|
236 | 236 | # - On Windows, services are handled by the puppet-agent MSI packages themselves.
|
237 | 237 | # ...but outside of PE, on other platforms, we must make sure the services are restarted. We do that with the
|
238 | 238 | # ::puppet_agent::service class. Make sure it's applied after the install process finishes if needed:
|
239 |
| - if $::osfamily != 'windows' and (!$is_pe or versioncmp($::clientversion, '4.0.0') < 0) { |
| 239 | + if $facts['os']['family'] != 'windows' and (!$is_pe or versioncmp($::clientversion, '4.0.0') < 0) { |
240 | 240 | Class['puppet_agent::configure']
|
241 | 241 | ~> contain('puppet_agent::service')
|
242 | 242 | }
|
|
0 commit comments