teamspeak: Convert to parameterized class

This commit is contained in:
Ossi Salmi 2013-07-10 16:40:26 +03:00
parent bf315c542d
commit d40e4f6d1c

View file

@ -1,13 +1,13 @@
# Install TeamSpeak server.
#
# === Global variables
# === Parameters
#
# $teamspeak_license:
# $license:
# Teamspeak license file source.
#
class teamspeak {
class teamspeak($package=undef, $license=undef) {
if !$teamspeak_package {
if ! $package {
case $::architecture {
"amd64","x86_64": {
if $teamspeak64_package_latest {
@ -24,6 +24,8 @@ class teamspeak {
}
}
}
} else {
$teamspeak_package = $package
}
case $::architecture {
@ -69,13 +71,13 @@ class teamspeak {
notify => Service["teamspeak"],
}
if $teamspeak_license {
if $license {
file { "/srv/teamspeak/licensekey.dat":
ensure => present,
mode => "0600",
owner => "teamspeak",
group => "teamspeak",
source => $teamspeak_license,
source => $license,
require => File["/srv/teamspeak"],
notify => Service["teamspeak"],
}