summaryrefslogtreecommitdiffstats
path: root/modules/tick/manifests/server/kapacitor.pp
blob: 11b384ce640446a5e878f5c45a11a2aecdb63804 (plain) (blame)
1
2
3
4
5
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
class tick::server::kapacitor {
  package::makepkg { 'kapacitor-bin':
    ensure => installed;
  }

  $smtp_password = secret::value('kapacitor_smtp_password')
  $smtp_to = secret::value('kapacitor_to')

  file {
    "/etc/kapacitor/kapacitor.conf":
      content => template('tick/kapacitor.conf'),
      require => Package::Makepkg['kapacitor-bin'],
      notify => Service['kapacitor'];
    "/etc/kapacitor/load":
      ensure => directory,
      require => Package::Makepkg['kapacitor-bin'];
    "/etc/kapacitor/load/tasks":
      ensure => directory,
      recurse => true,
      purge => true,
      require => File["/etc/kapacitor/load"],
      notify => Service['kapacitor'];
    "/media/persistent/kapacitor":
      ensure => directory,
      owner => "kapacitor",
      group => "kapacitor",
      require => Package::Makepkg['kapacitor-bin'];
  }

  service { 'kapacitor':
    ensure => running,
    enable => true,
    require => Package::Makepkg['kapacitor-bin'];
  }
}