diff --git a/teamspeak/manifests/init.pp b/teamspeak/manifests/init.pp index 2cff261..00be6f3 100644 --- a/teamspeak/manifests/init.pp +++ b/teamspeak/manifests/init.pp @@ -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"], }