Puppet Class: ventrilo::rhel::config

Defined in:
manifests/rhel/config.pp

Overview



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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# File 'manifests/rhel/config.pp', line 8

class ventrilo::rhel::config {
  #make our parameters local scope
  File{} -> Anchor['ventrilo::config::end']
  $ensure        = $ventrilo::ensure
  $adminpassword = $ventrilo::adminpass
  $authmode      = $ventrilo::authmode
  $autokick      = $ventrilo::autokick
  $chanclients   = $ventrilo::chanclients
  $chandepth     = $ventrilo::chandepth
  $chanwidth     = $ventrilo::chanwidth
  $closestd      = $ventrilo::closestd
  $disablequit   = $ventrilo::disablequit
  $duplicates    = $ventrilo::duplicates
  $extrabuffer   = $ventrilo::extrabuffer
  $logontimeout  = $ventrilo::logontimeout
  $password      = $ventrilo::password
  $pingrate      = $ventrilo::pingrate
  $recvbuffer    = $ventrilo::recvbuffer
  $sendbuffer    = $ventrilo::sendbuffer
  $servername    = $ventrilo::servername
  $silentlobby   = $ventrilo::silentlobby
  $timestamp     = $ventrilo::timestamp
  $ventport      = $ventrilo::ventport
  $voicecodec    = $ventrilo::voicecodec
  $voiceformat   = $ventrilo::voiceformat
  # end of variables
  case $ensure {
    present, enabled, active, disabled, stopped: {
      #everything should be installed
      file {'ventrilo_conf':
        ensure  => 'present',
        path    =>  "/usr/local/ventsrv/${ventport}.ini",
        owner   => 'root',
        group   => 'root',
        mode    => '0640',
        content => template('ventrilo/usr/local/ventsrv/ventrilo_srv.ini.erb'),
        require => Package['Ventrilo'],
      }#end ventrilo_conf file

      file {'ventrilo_defaultconf':
        ensure  => 'present',
        path    => '/usr/local/ventsrv/ventrilo_srv.ini',
        owner   => 'ventrilo',
        group   => 'ventrilo',
        mode    => '0640',
        source  => "puppet:///modules/${module_name}/ventrilo_srv.ini",
        require => Package['Ventrilo'],
      }#end ventrilod.conf file

      file {'/usr/local/ventsrv':
        ensure => 'directory',
        owner  => 'ventrilo',
        group  => 'ventrilo',
        mode   => '0755',
      }#End ventrilo dir

      file {'/etc/init.d/ventrilo':
        ensure  => 'present',
        owner   => 'root',
        group   => 'root',
        mode    => '0755',
        content => template('ventrilo/etc/init.d/ventrilo_init.erb'),
        require => Package['Ventrilo'],
      }#End init file

    }#end configfiles should be present case
    absent: {
      file {'ventrilo_conf':
        ensure  => 'absent',
        path    =>  "/usr/local/ventsrv/${ventport}.ini",
      }#end ventrilod.conf file
      file {'ventrilo_defaultconf':
        ensure  => 'absent',
        path    => '/usr/local/ventsrv/ventrilo_srv.ini',
      }#end ventrilod.conf file
      file {'/etc/init.d/ventrilo':
        ensure => 'absent',
      }#End init file
      file {'/usr/local/ventsrv':
        ensure => 'absent',
        force  => true,
      }#end ventrilodir

    }#end configfiles should be absent case
    default: {
      notice "ventrilo::ensure has an unsupported value of ${ventrilo::ensure}."
    }#end default ensure case
  }#end ensure case
}