-
Notifications
You must be signed in to change notification settings - Fork 83
/
icinga2.pp
52 lines (52 loc) · 1.52 KB
/
icinga2.pp
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class profiles::dashing::icinga2 (
$icingaweb2_listen_ip,
){
package { [ 'rubygems', 'rubygem-bundler',
'ruby-devel', 'openssl', 'gcc-c++',
'make', 'nodejs', 'v8'
]:
ensure => 'installed',
}->
vcsrepo { '/usr/share/dashing-icinga2':
ensure => 'present',
path => '/usr/share/dashing-icinga2',
provider => 'git',
revision => 'master',
source => 'https://github.com/dnsmichi/dashing-icinga2.git',
force => true,
require => Package['git']
}->
exec { 'dashing-bundle-install':
path => '/bin:/usr/bin:/sbin:/usr/sbin',
command => "cd /usr/share/dashing-icinga2 && bundle install --jobs 4 --system", # this already installs the dashing binary
timeout => 1800
}->
file { 'icinga2.local.json':
name => '/usr/share/dashing-icinga2/config/icinga2.local.json',
owner => root,
group => root,
mode => '0644',
content => template("profiles/dashing/config/icinga2.local.json.erb")
}
->
file { '/usr/lib/systemd/system/dashing-icinga2.service':
owner => root,
group => root,
mode => '0644',
source => '/usr/share/dashing-icinga2/tools/systemd/dashing-icinga2.service',
}
->
exec { 'dashing-reload-systemd':
command => 'systemctl daemon-reload',
path => ['/usr/bin', '/usr/sbin', '/bin', '/sbin'],
refreshonly => true,
}
->
service { 'dashing-icinga2':
provider => 'systemd',
ensure => running,
enable => true,
hasstatus => true,
hasrestart => true,
}
}