summaryrefslogtreecommitdiff
path: root/manifests/config.pp
blob: d6675c3afcce58875d6c87f66c902341a3561236 (plain)
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 check_mk::config {
  file_line { 'nagios-remove-localhost':
    ensure => absent,
    line   => 'cfg_file=/etc/nagios/objects/localhost.cfg',
    path   => '/etc/nagios/nagios.cfg',
    notify => Class['check_mk::service'],
  }
  file_line { 'nagios-add-check_mk-cfg_dir':
    ensure => present,
    line   => 'cfg_dir=/etc/nagios/check_mk',
    path   => '/etc/nagios/nagios.cfg',
    notify => Class['check_mk::service'],
  }
  concat { '/etc/check_mk/main.mk':
    owner  => 'root',
    group  => 'root',
    mode   => '0644',
    notify => Exec['check_mk-restart'],
  }
  concat::fragment { 'all_hosts-header':
    target  => '/etc/check_mk/main.mk',
    content => "all_hosts = [\n",
    order   => 01,
  }
  concat::fragment { 'all_hosts-footer':
    target  => '/etc/check_mk/main.mk',
    content => "]\n",
    order   => 03,
  }
  Check_mk::Host <<| |>> { notify => Exec['check_mk-restart'] }
  exec { 'check_mk-restart':
    command     => '/usr/bin/check_mk -O',
    refreshonly => true,
  }
}