Puppet Class: splunk::server::general

Defined in:
manifests/server/general.pp

Overview

Parameters:

  • pass4symmkey (Any) (defaults to: $splunk::pass4symmkey)
  • splunk_os_user (Any) (defaults to: $splunk::real_splunk_os_user)
  • splunk_os_group (Any) (defaults to: $splunk::real_splunk_os_group)
  • splunk_dir_mode (Any) (defaults to: $splunk::real_splunk_dir_mode)
  • splunk_file_mode (Any) (defaults to: $splunk::real_splunk_file_mode)
  • splunk_app_precedence_dir (Any) (defaults to: $splunk::splunk_app_precedence_dir)
  • splunk_app_replace (Any) (defaults to: $splunk::splunk_app_replace)
  • splunk_home (Any) (defaults to: $splunk::splunk_home)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'manifests/server/general.pp', line 6

class splunk::server::general (
  $pass4symmkey = $splunk::pass4symmkey,
  $splunk_os_user = $splunk::real_splunk_os_user,
  $splunk_os_group = $splunk::real_splunk_os_group,
  $splunk_dir_mode = $splunk::real_splunk_dir_mode,
  $splunk_file_mode = $splunk::real_splunk_file_mode,
  $splunk_app_precedence_dir = $splunk::splunk_app_precedence_dir,
  $splunk_app_replace = $splunk::splunk_app_replace,
  $splunk_home = $splunk::splunk_home
){
  $splunk_app_name = 'puppet_common_pass4symmkey_base'
  case $::osfamily {
    /^[Ww]indows$/: {
      # On Windows we cannot delete pass4SymmKey from [general], because there
      # is no Augeas provider on Windows 
    }
    default: {
      # delete pass4SymmKey from [general] in etc/system/local/server.conf,
      # otherwise our pass4SymmKey in the app below will be overruled
      augeas { "${splunk_home}/etc/system/local/server.conf pass4symmkey":
        lens    => 'Puppet.lns',
        incl    => "${splunk_home}/etc/system/local/server.conf",
        changes => [
          'rm general/pass4SymmKey',
        ],
      }
    }
  }
  file { [
    "${splunk_home}/etc/apps/${splunk_app_name}",
    "${splunk_home}/etc/apps/${splunk_app_name}/${splunk_app_precedence_dir}",
    "${splunk_home}/etc/apps/${splunk_app_name}/metadata",]:
    ensure => directory,
    owner  => $splunk_os_user,
    group  => $splunk_os_group,
    mode   => $splunk_dir_mode,
  }
  -> file { "${splunk_home}/etc/apps/${splunk_app_name}/${splunk_app_precedence_dir}/server.conf":
    ensure  => present,
    owner   => $splunk_os_user,
    group   => $splunk_os_group,
    mode    => $splunk_file_mode,
    replace => $splunk_app_replace,
    content => template("splunk/${splunk_app_name}/local/server.conf"),
  }
}