153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
|
# File 'manifests/forwarder.pp', line 153
class splunk::forwarder (
String[1] $server = $splunk::params::server,
String[1] $version = $splunk::params::version,
String[1] $package_name = $splunk::params::forwarder_package_name,
String[1] $package_ensure = $splunk::params::forwarder_package_ensure,
String[1] $staging_dir = $splunk::params::staging_dir,
String[1] $path_delimiter = $splunk::params::path_delimiter,
String[1] $forwarder_package_src = $splunk::params::forwarder_package_src,
Optional[String[1]] $package_provider = $splunk::params::package_provider,
Boolean $manage_package_source = true,
Optional[String[1]] $package_source = undef,
Splunk::Fwdinstalloptions $install_options = $splunk::params::forwarder_install_options,
String[1] $splunk_user = $splunk::params::splunk_user,
Stdlib::Absolutepath $forwarder_homedir = $splunk::params::forwarder_homedir,
Stdlib::Absolutepath $forwarder_confdir = $splunk::params::forwarder_confdir,
String[1] $service_name = $splunk::params::forwarder_service,
Stdlib::Absolutepath $service_file = $splunk::params::forwarder_service_file,
Boolean $boot_start = $splunk::params::boot_start,
Boolean $use_default_config = true,
Stdlib::IP::Address $splunkd_listen = '127.0.0.1',
Stdlib::Port $splunkd_port = $splunk::params::splunkd_port,
Stdlib::Port $logging_port = $splunk::params::logging_port,
Boolean $purge_deploymentclient = false,
Boolean $purge_outputs = false,
Boolean $purge_inputs = false,
Boolean $purge_props = false,
Boolean $purge_transforms = false,
Boolean $purge_web = false,
Hash $forwarder_output = $splunk::params::forwarder_output,
Hash $forwarder_input = $splunk::params::forwarder_input,
Boolean $manage_password = $splunk::params::manage_password,
Boolean $seed_password = $splunk::params::seed_password,
Boolean $reset_seeded_password = $splunk::params::reset_seeded_password,
Stdlib::Absolutepath $password_config_file = $splunk::params::forwarder_password_config_file,
Stdlib::Absolutepath $seed_config_file = $splunk::params::forwarder_seed_config_file,
String[1] $password_content = $splunk::params::password_content,
String[1] $password_hash = $splunk::params::password_hash,
String[1] $seed_user = $splunk::params::seed_user,
Stdlib::Absolutepath $secret_file = $splunk::params::forwarder_secret_file,
String[1] $secret = $splunk::params::secret,
Hash $addons = {},
) inherits splunk {
if (defined(Class['splunk::enterprise'])) {
fail('Splunk Universal Forwarder provides a subset of Splunk Enterprise capabilities, and has potentially conflicting resources when included with Splunk Enterprise on the same node. Do not include splunk::forwarder on the same node as splunk::enterprise. Configure Splunk Enterprise to meet your forwarding needs.'
)
}
if ($facts['os']['family'] == 'windows') and ($package_ensure == 'latest') {
fail('This module does not currently support continuously upgrading the Splunk Universal Forwarder on Windows. Please do not set "package_ensure" to "latest" on Windows.')
}
if $manage_password and $seed_password {
fail('The setting "manage_password" and "seed_password" are in conflict with one another; they are two ways of accomplishing the same goal, "seed_password" is preferred according to Splunk documentation. If you need to reset the admin user password after initially installation then set "reset_seeded_password" temporarily.')
}
if $manage_password {
info("The setting \"manage_password\" will manage the contents of ${password_config_file} which Splunk changes on restart, this results in Puppet initiating a corrective change event on every run and will trigger a resart of all Splunk services")
}
if $reset_seeded_password {
info("The setting \"reset_seeded_password\" will delete ${password_config_file} on each run of Puppet and generate a corrective change event, the file must be absent for Splunk's admin password seeding process to be triggered so this setting should only be used temporarily as it'll also cause a resart of the Splunk service")
}
contain 'splunk::forwarder::install'
contain 'splunk::forwarder::config'
contain 'splunk::forwarder::service'
Class['splunk::forwarder::install']
-> Class['splunk::forwarder::config']
~> Class['splunk::forwarder::service']
# This is a module that supports multiple platforms. For some platforms
# there is non-generic configuration that needs to be declared in addition
# to the agnostic resources declared here.
if $facts['kernel'] in ['Linux', 'SunOS', 'FreeBSD'] {
contain 'splunk::forwarder::service::nix'
Class['splunk::forwarder::config']
-> Class['splunk::forwarder::service::nix']
-> Class['splunk::forwarder::service']
}
Splunk_config['splunk'] {
forwarder_confdir => $forwarder_confdir,
purge_forwarder_deploymentclient => $purge_deploymentclient,
purge_forwarder_outputs => $purge_outputs,
purge_forwarder_inputs => $purge_inputs,
purge_forwarder_props => $purge_props,
purge_forwarder_transforms => $purge_transforms,
purge_forwarder_web => $purge_web,
}
}
|