Updated munin::server for Munin 2.0
This commit is contained in:
parent
2390603711
commit
51ed3c152c
5 changed files with 66 additions and 23 deletions
|
@ -55,11 +55,10 @@ class munin::node {
|
|||
}
|
||||
}
|
||||
|
||||
@@file { "/etc/munin/nodes.d/${homename}.conf":
|
||||
@@file { "/etc/munin/conf.d/${homename}.conf":
|
||||
ensure => present,
|
||||
content => "[${homename}]\n address ${ipaddress}\n use_node_name yes\n",
|
||||
tag => "munin",
|
||||
notify => Exec["generate-munin-conf"],
|
||||
}
|
||||
|
||||
exec { "munin-node-configure":
|
||||
|
@ -104,11 +103,10 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
|
|||
notify => Service["munin-node"],
|
||||
}
|
||||
|
||||
@@file { "/etc/munin/nodes.d/${name}.conf":
|
||||
@@file { "/etc/munin/conf.d/${name}.conf":
|
||||
ensure => present,
|
||||
content => "[${name}]\n address ${ipaddress}\n use_node_name no\n",
|
||||
tag => "munin",
|
||||
notify => Exec["generate-munin-conf"],
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -238,9 +236,9 @@ class munin::server {
|
|||
|
||||
file { "/var/cache/munin":
|
||||
ensure => directory,
|
||||
mode => "0755",
|
||||
mode => "0775",
|
||||
owner => "munin",
|
||||
group => "munin",
|
||||
group => $apache::sslserver::group,
|
||||
seltype => "httpd_munin_content_t",
|
||||
require => Package["munin"],
|
||||
}
|
||||
|
@ -253,13 +251,40 @@ class munin::server {
|
|||
atboot => true,
|
||||
device => "none",
|
||||
fstype => "tmpfs",
|
||||
options => "uid=munin,gid=munin,mode=0755",
|
||||
options => "uid=munin,gid=${$apache::sslserver::group},mode=0775",
|
||||
dump => "0",
|
||||
pass => "0",
|
||||
require => File["/var/cache/munin"],
|
||||
}
|
||||
|
||||
file { "/etc/munin/nodes.d":
|
||||
file { [ "/var/log/munin/munin-cgi-graph.log",
|
||||
"/var/log/munin/munin-cgi-html.log", ]:
|
||||
ensure => present,
|
||||
mode => "0664",
|
||||
owner => "munin",
|
||||
group => $apache::sslserver::group,
|
||||
require => Package["munin"],
|
||||
}
|
||||
|
||||
file { "/var/www/html/munin/.htaccess":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
source => [ "puppet:///files/munin/htaccess",
|
||||
"puppet:///modules/munin/munin-htaccess", ],
|
||||
require => Package["munin"],
|
||||
}
|
||||
file { "/var/www/html/munin/cgi/.htaccess":
|
||||
ensure => present,
|
||||
mode => "0644",
|
||||
owner => "root",
|
||||
group => "root",
|
||||
source => "puppet:///modules/munin/cgi-htaccess",
|
||||
require => Package["munin"],
|
||||
}
|
||||
|
||||
file { "/etc/munin/conf.d":
|
||||
ensure => directory,
|
||||
purge => true,
|
||||
force => true,
|
||||
|
@ -271,22 +296,13 @@ class munin::server {
|
|||
require => Package["munin"],
|
||||
}
|
||||
|
||||
file { "/etc/munin/munin.conf.in":
|
||||
file { "/etc/munin/munin.conf":
|
||||
ensure => present,
|
||||
content => template("munin/munin.conf.in.erb"),
|
||||
content => template("munin/munin.conf.erb"),
|
||||
owner => "root",
|
||||
group => "root",
|
||||
mode => "0644",
|
||||
require => Package["munin"],
|
||||
notify => Exec["generate-munin-conf"],
|
||||
}
|
||||
|
||||
exec { "generate-munin-conf":
|
||||
command => "cat /etc/munin/munin.conf.in /etc/munin/nodes.d/*.conf > /etc/munin/munin.conf",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
user => root,
|
||||
refreshonly => true,
|
||||
require => File["/etc/munin/munin.conf.in"],
|
||||
}
|
||||
|
||||
File <<| tag == "munin" |>>
|
||||
|
@ -294,12 +310,17 @@ class munin::server {
|
|||
define configwebhost() {
|
||||
file { "/srv/www/https/${name}/munin":
|
||||
ensure => link,
|
||||
target => "/var/cache/munin",
|
||||
target => "/var/www/html/munin",
|
||||
require => File["/srv/www/https/${name}"],
|
||||
}
|
||||
}
|
||||
|
||||
if $munin_webhosts {
|
||||
apache::configfile { "munin.conf":
|
||||
http => false,
|
||||
source => "puppet:///modules/munin/munin-httpd.conf",
|
||||
}
|
||||
|
||||
configwebhost { $munin_webhosts: }
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue