Puppet Class: splunk::password

Inherits:
splunk::params
Defined in:
manifests/password.pp

Overview

password_config_file

which file to put the password in i.e. in linux it would be /opt/splunkforwarder/etc/passwd

secret_file

which file we should put the secret in

passord_content

the hashed password username/details for the user

service_password

are we passwording splunkforwarder or splunk - currently tested with splunkforwarder only

license

which service we should expect the licesnse to be accepted for

sponsored by balgroup

Parameters:

  • password_config_file (Any) (defaults to: $splunk::params::password_config_file)
  • secret_file (Any) (defaults to: $splunk::params::secret_file)
  • secret (Any) (defaults to: $splunk::params::secret)
  • password_content (Any) (defaults to: $splunk::params::password_content)
  • service_password (Any) (defaults to: 'splunk_forwarder')
  • virtual_service (Any) (defaults to: $splunk::params::forwarder_service)
  • license (Any) (defaults to: 'license_splunkforwarder')
  • package_name (Any) (defaults to: $splunk::params::forwarder_pkg_name)


29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'manifests/password.pp', line 29

class splunk::password(
  $password_config_file = $splunk::params::password_config_file,
  $secret_file          = $splunk::params::secret_file,
  $secret               = $splunk::params::secret,
  $password_content     = $splunk::params::password_content,
  $service_password     = 'splunk_forwarder',
  $virtual_service      = $splunk::params::forwarder_service,
  $license              = 'license_splunkforwarder',
  $package_name         = $splunk::params::forwarder_pkg_name,
) inherits splunk::params {
  if ! defined(Class['splunk::forwarder']) and ! defined(Class['splunk']){
    fail('You must include the splunk forwarder or splunk class before changing the password defined resources')
  }

  file { $password_config_file:
    ensure  => file,
    content => $password_content,
    require => Package[$package_name],
    notify  => Service[$virtual_service],
    tag     => 'splunk_password',
  }

  file { $secret_file:
    ensure  => file,
    content => $secret,
    require => Package[$package_name],
    notify  => Service[$virtual_service],
  }
}