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