include motd
include utils
include cron
- include munin::client
+
+ # We include munin configuration if it's not defined by
+ # and exported resource.
+ if !defined(nodo::vserver::Munin[$hostname]) {
+ include munin::client
+ }
# Set timezone and ntp config
#
define munin($type, $id) {
# Use one port for each node
- $munin_port = "49$id"
- case $type {
- 'host': {
- include munin::host
- include munin::client
- }
- 'client': {
- include munin::client
- }
- }
+ $munin_port = "59$id"
+ include munin::client
}
+ # Apply munin configuration for this node
+ nodo::vserver::Munin <| tag == $name |>
+
# Define a vserver instance
define instance($context, $ensure = 'running', $proxy = false, $puppetmaster = false, $gitd = false,
- $munin = 'client', $icecast = false, $sound = false, $ticket = false) {
+ $icecast = false, $sound = false, $ticket = false) {
# set instance id
if $context < 9 {
require => Exec["vs_create_${name}"],
}
+ # Create a munin virtual resource to be realized in the node
+ @nodo::vserver::munin {
+ id => $id,
+ tag => $name,
+ }
+
# Sound support
if $sound {
if !defined(File["/usr/local/sbin/create-sound-devices"]) {
destinationport => '8140',
originaldest => "$ipaddress",
ratelimit => '-',
- order => '304',
+ order => "3$id",
+ }
+
+ shorewall::rule { "munin-$context":
+ action => 'DNAT',
+ source => 'net',
+ destination => "vm:192.168.0.$context:59$id",
+ proto => 'tcp',
+ destinationport => "59$id",
+ ratelimit => '-',
+ order => "4$id",
}
if $proxy {
proto => 'tcp',
destinationport => '80',
ratelimit => '-',
- order => '300',
+ order => '500',
}
shorewall::rule { 'https-route':
proto => 'tcp',
destinationport => '443',
ratelimit => '-',
- order => '301',
+ order => '501',
}
}
proto => 'tcp',
destinationport => '8140',
ratelimit => '-',
- order => '302',
+ order => '502',
}
shorewall::rule { 'puppetmaster-2':
proto => 'udp',
destinationport => '8140',
ratelimit => '-',
- order => '303',
+ order => '503',
}
shorewall::rule { 'puppetmaster-3':
destinationport => '8140',
originaldest => "$ipaddress",
ratelimit => '-',
- order => '304',
+ order => '504',
}
shorewall::rule { 'puppetmaster-4':
destinationport => '8140',
originaldest => "$ipaddress",
ratelimit => '-',
- order => '305',
+ order => '505',
}
}
proto => 'tcp',
destinationport => '9418',
ratelimit => '-',
- order => '306',
+ order => '506',
}
shorewall::rule { 'git-daemon-2':
proto => 'tcp',
destinationport => '9418',
ratelimit => '-',
- order => '307',
+ order => '507',
}
}
proto => 'tcp',
destinationport => '8000',
ratelimit => '-',
- order => '308',
+ order => '508',
}
shorewall::rule { 'icecast-2':
proto => 'tcp',
destinationport => '8000',
ratelimit => '-',
- order => '309',
+ order => '509',
}
}
}