Fixing puppet-lint errors.
This commit is contained in:
parent
2f83cb7d4a
commit
34c36045fa
59 changed files with 995 additions and 990 deletions
|
@ -2,61 +2,61 @@
|
|||
# Install and configure munin node.
|
||||
#
|
||||
class munin::node {
|
||||
|
||||
|
||||
package { "munin-node":
|
||||
ensure => installed,
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
|
||||
service { "munin-node":
|
||||
name => $operatingsystem ? {
|
||||
name => $operatingsystem ? {
|
||||
OpenBSD => $operatingsystemrelease ? {
|
||||
/4\.[1-8]/ => "munin-node",
|
||||
default => "munin_node",
|
||||
},
|
||||
default => "munin-node",
|
||||
},
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package["munin-node"],
|
||||
start => $operatingsystem ? {
|
||||
OpenBSD => $operatingsystemrelease ? {
|
||||
ensure => running,
|
||||
enable => true,
|
||||
require => Package["munin-node"],
|
||||
start => $operatingsystem ? {
|
||||
OpenBSD => $operatingsystemrelease ? {
|
||||
/4\.[1-8]/ => "/usr/bin/install -d -o _munin /var/run/munin; /usr/local/sbin/munin-node",
|
||||
default => undef,
|
||||
},
|
||||
default => undef,
|
||||
},
|
||||
stop => $operatingsystem ? {
|
||||
OpenBSD => "/usr/bin/pkill -f /usr/local/sbin/munin-node",
|
||||
default => undef,
|
||||
},
|
||||
default => undef,
|
||||
},
|
||||
stop => $operatingsystem ? {
|
||||
OpenBSD => "/usr/bin/pkill -f /usr/local/sbin/munin-node",
|
||||
default => undef,
|
||||
},
|
||||
}
|
||||
|
||||
file { "/etc/munin/munin-node.conf":
|
||||
ensure => present,
|
||||
content => template("munin/munin-node.conf.erb"),
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
default => root,
|
||||
},
|
||||
mode => 0644,
|
||||
require => Package["munin-node"],
|
||||
notify => Exec["munin-node-configure"],
|
||||
ensure => present,
|
||||
content => template("munin/munin-node.conf.erb"),
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
default => root,
|
||||
},
|
||||
mode => 0644,
|
||||
require => Package["munin-node"],
|
||||
notify => Exec["munin-node-configure"],
|
||||
}
|
||||
|
||||
|
||||
@@file { "/etc/munin/nodes.d/${homename}.conf":
|
||||
content => "[${homename}]\n address ${ipaddress}\n use_node_name yes\n",
|
||||
ensure => present,
|
||||
tag => "munin",
|
||||
notify => Exec["generate-munin-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":
|
||||
command => "munin-node-configure --shell --remove-also 2>/dev/null | /bin/sh",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
|
||||
user => root,
|
||||
refreshonly => true,
|
||||
notify => Service["munin-node"],
|
||||
command => "munin-node-configure --shell --remove-also 2>/dev/null | /bin/sh",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin",
|
||||
user => root,
|
||||
refreshonly => true,
|
||||
notify => Service["munin-node"],
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -82,8 +82,8 @@ class munin::node {
|
|||
define munin::snmpnode($snmp_community="public", $snmp_version="2") {
|
||||
|
||||
file { "/etc/munin/plugin-conf.d/snmp_${name}":
|
||||
content => "[snmp_${name}_*]\nenv.community ${snmp_community}\nenv.version ${snmp_version}\n",
|
||||
ensure => present,
|
||||
content => "[snmp_${name}_*]\nenv.community ${snmp_community}\nenv.version ${snmp_version}\n",
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
|
@ -94,8 +94,8 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
|
|||
}
|
||||
|
||||
@@file { "/etc/munin/nodes.d/${name}.conf":
|
||||
content => "[${name}]\n address ${ipaddress}\n use_node_name no\n",
|
||||
ensure => present,
|
||||
content => "[${name}]\n address ${ipaddress}\n use_node_name no\n",
|
||||
tag => "munin",
|
||||
notify => Exec["generate-munin-conf"],
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
|
|||
# === Parameters
|
||||
#
|
||||
# $name:
|
||||
# Plugin name to install.
|
||||
# Plugin name to install.
|
||||
# $config:
|
||||
# Configuration file name associated with plugin. Defaults to none.
|
||||
#
|
||||
|
@ -121,71 +121,71 @@ define munin::snmpnode($snmp_community="public", $snmp_version="2") {
|
|||
define munin::plugin($config = "") {
|
||||
|
||||
case $operatingsystem {
|
||||
OpenBSD: {
|
||||
file { "/usr/local/libexec/munin/plugins/${name}":
|
||||
ensure => present,
|
||||
source => "puppet:///modules/munin/plugins/${name}",
|
||||
owner => root,
|
||||
group => wheel,
|
||||
mode => 0755,
|
||||
require => Package["munin-node"],
|
||||
}
|
||||
OpenBSD: {
|
||||
file { "/usr/local/libexec/munin/plugins/${name}":
|
||||
ensure => present,
|
||||
source => "puppet:///modules/munin/plugins/${name}",
|
||||
owner => root,
|
||||
group => wheel,
|
||||
mode => 0755,
|
||||
require => Package["munin-node"],
|
||||
}
|
||||
}
|
||||
default: {
|
||||
file { "/usr/share/munin/plugins/${name}":
|
||||
ensure => present,
|
||||
source => "puppet:///modules/munin/plugins/${name}",
|
||||
owner => root,
|
||||
group => root,
|
||||
mode => 0755,
|
||||
require => Package["munin-node"],
|
||||
}
|
||||
}
|
||||
default: {
|
||||
file { "/usr/share/munin/plugins/${name}":
|
||||
ensure => present,
|
||||
source => "puppet:///modules/munin/plugins/${name}",
|
||||
owner => root,
|
||||
group => root,
|
||||
mode => 0755,
|
||||
require => Package["munin-node"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($config) {
|
||||
file { "/etc/munin/plugin-conf.d/${config}":
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/munin/plugin-conf/${config}.${fqdn}",
|
||||
"puppet:///files/munin/plugin-conf/${config}",
|
||||
"puppet:///modules/munin/plugin-conf/${config}", ],
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
default => root,
|
||||
},
|
||||
mode => 0644,
|
||||
notify => Service["munin-node"],
|
||||
require => $operatingsystem ? {
|
||||
OpenBSD => File["/usr/local/libexec/munin/plugins/${name}"],
|
||||
default => File["/usr/share/munin/plugins/${name}"],
|
||||
file { "/etc/munin/plugin-conf.d/${config}":
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/munin/plugin-conf/${config}.${fqdn}",
|
||||
"puppet:///files/munin/plugin-conf/${config}",
|
||||
"puppet:///modules/munin/plugin-conf/${config}", ],
|
||||
owner => root,
|
||||
group => $operatingsystem ? {
|
||||
OpenBSD => wheel,
|
||||
default => root,
|
||||
},
|
||||
}
|
||||
mode => 0644,
|
||||
notify => Service["munin-node"],
|
||||
require => $operatingsystem ? {
|
||||
OpenBSD => File["/usr/local/libexec/munin/plugins/${name}"],
|
||||
default => File["/usr/share/munin/plugins/${name}"],
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
case $operatingsystem {
|
||||
OpenBSD: {
|
||||
exec { "munin-enable-${name}":
|
||||
command => "ln -s /usr/local/libexec/munin/plugins/${name} /etc/munin/plugins/${name}",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
user => root,
|
||||
onlyif => [ "test ! -h /etc/munin/plugins/${name}",
|
||||
"/usr/local/libexec/munin/plugins/${name} autoconf", ],
|
||||
notify => Service["munin-node"],
|
||||
require => File["/usr/local/libexec/munin/plugins/${name}"],
|
||||
}
|
||||
}
|
||||
default: {
|
||||
exec { "munin-enable-${name}":
|
||||
command => "ln -s /usr/share/munin/plugins/${name} /etc/munin/plugins/${name}",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
user => root,
|
||||
onlyif => [ "test ! -h /etc/munin/plugins/${name}",
|
||||
"/usr/share/munin/plugins/${name} autoconf", ],
|
||||
notify => Service["munin-node"],
|
||||
require => File["/usr/share/munin/plugins/${name}"],
|
||||
}
|
||||
}
|
||||
OpenBSD: {
|
||||
exec { "munin-enable-${name}":
|
||||
command => "ln -s /usr/local/libexec/munin/plugins/${name} /etc/munin/plugins/${name}",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
user => root,
|
||||
onlyif => [ "test ! -h /etc/munin/plugins/${name}",
|
||||
"/usr/local/libexec/munin/plugins/${name} autoconf", ],
|
||||
notify => Service["munin-node"],
|
||||
require => File["/usr/local/libexec/munin/plugins/${name}"],
|
||||
}
|
||||
}
|
||||
default: {
|
||||
exec { "munin-enable-${name}":
|
||||
command => "ln -s /usr/share/munin/plugins/${name} /etc/munin/plugins/${name}",
|
||||
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||
user => root,
|
||||
onlyif => [ "test ! -h /etc/munin/plugins/${name}",
|
||||
"/usr/share/munin/plugins/${name} autoconf", ],
|
||||
notify => Service["munin-node"],
|
||||
require => File["/usr/share/munin/plugins/${name}"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -198,13 +198,13 @@ define munin::plugin($config = "") {
|
|||
# * Storedconfigs
|
||||
#
|
||||
class munin::server {
|
||||
|
||||
|
||||
package { "munin":
|
||||
ensure => installed,
|
||||
ensure => installed,
|
||||
}
|
||||
|
||||
|
||||
if $munin_datadir {
|
||||
file { "${munin_datadir}":
|
||||
file { $munin_datadir:
|
||||
ensure => directory,
|
||||
mode => 0755,
|
||||
owner => munin,
|
||||
|
@ -220,15 +220,15 @@ class munin::server {
|
|||
}
|
||||
|
||||
file { "/var/lib/munin":
|
||||
ensure => "${munin_datadir}",
|
||||
ensure => $munin_datadir,
|
||||
force => true,
|
||||
backup => ".orig",
|
||||
require => File["${munin_datadir}"],
|
||||
require => File[$munin_datadir],
|
||||
}
|
||||
}
|
||||
|
||||
if $munin_htmldir {
|
||||
file { "${munin_htmldir}":
|
||||
file { $munin_htmldir:
|
||||
ensure => directory,
|
||||
mode => 0755,
|
||||
owner => munin,
|
||||
|
@ -248,45 +248,45 @@ class munin::server {
|
|||
}
|
||||
|
||||
file { "/var/www/html/munin":
|
||||
ensure => "${munin_htmldir}",
|
||||
ensure => $munin_htmldir,
|
||||
force => true,
|
||||
backup => ".orig",
|
||||
seltype => "munin_var_lib_t",
|
||||
require => File["${munin_htmldir}"],
|
||||
require => File[$munin_htmldir],
|
||||
}
|
||||
}
|
||||
|
||||
file { "/etc/munin/nodes.d":
|
||||
ensure => directory,
|
||||
purge => true,
|
||||
force => true,
|
||||
recurse => true,
|
||||
owner => root,
|
||||
group => root,
|
||||
mode => 0644,
|
||||
source => "puppet:///modules/custom/empty",
|
||||
require => Package["munin"],
|
||||
ensure => directory,
|
||||
purge => true,
|
||||
force => true,
|
||||
recurse => true,
|
||||
owner => root,
|
||||
group => root,
|
||||
mode => 0644,
|
||||
source => "puppet:///modules/custom/empty",
|
||||
require => Package["munin"],
|
||||
}
|
||||
|
||||
|
||||
file { "/etc/munin/munin.conf.in":
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/munin/munin.conf.in",
|
||||
"puppet:///modules/munin/munin.conf.in", ],
|
||||
owner => root,
|
||||
group => root,
|
||||
mode => 0644,
|
||||
require => Package["munin"],
|
||||
notify => Exec["generate-munin-conf"],
|
||||
ensure => present,
|
||||
source => [ "puppet:///files/munin/munin.conf.in",
|
||||
"puppet:///modules/munin/munin.conf.in", ],
|
||||
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"],
|
||||
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" |>>
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue