Initial version of teamspeak module
This commit is contained in:
parent
4b0c766c5a
commit
b65f713fd6
4 changed files with 204 additions and 0 deletions
25
teamspeak/Makefile
Normal file
25
teamspeak/Makefile
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
include $(CURDIR)/../Makefile.inc
|
||||||
|
|
||||||
|
VERSION = 3.0.7.1
|
||||||
|
|
||||||
|
TARGET32 = teamspeak3-server_linux-x86-$(VERSION).tar.gz
|
||||||
|
SOURCE32 = http://ftp.4players.de/pub/hosted/ts3/releases/$(VERSION)/teamspeak3-server_linux-x86-$(VERSION).tar.gz
|
||||||
|
TARGET64 = teamspeak3-server_linux-amd64-$(VERSION).tar.gz
|
||||||
|
SOURCE64 = http://ftp.4players.de/pub/hosted/ts3/releases/$(VERSION)/teamspeak3-server_linux-amd64-$(VERSION).tar.gz
|
||||||
|
|
||||||
|
all: download manifest
|
||||||
|
download: $(PACKAGES)/$(TARGET32) $(PACKAGES)/$(TARGET64)
|
||||||
|
manifest: $(MANIFESTS)/teamspeak.pp
|
||||||
|
|
||||||
|
$(PACKAGES)/$(TARGET32):
|
||||||
|
@umask 022; echo $@; \
|
||||||
|
test -f $@ || curl -o $@ $(SOURCE32)
|
||||||
|
|
||||||
|
$(PACKAGES)/$(TARGET64):
|
||||||
|
@umask 022; echo $@; \
|
||||||
|
test -f $@ || curl -o $@ $(SOURCE64)
|
||||||
|
|
||||||
|
$(MANIFESTS)/teamspeak.pp: $(PACKAGES)/$(TARGET32) $(PACKAGES)/$(TARGET64)
|
||||||
|
@umask 022; echo $@; \
|
||||||
|
echo '$$teamspeak32_package_latest = "$(TARGET32)"' > $@ && \
|
||||||
|
echo '$$teamspeak64_package_latest = "$(TARGET64)"' >> $@
|
19
teamspeak/files/ts3server.ini
Normal file
19
teamspeak/files/ts3server.ini
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
machine_id=
|
||||||
|
default_voice_port=9987
|
||||||
|
voice_ip=0.0.0.0
|
||||||
|
licensepath=
|
||||||
|
filetransfer_port=30033
|
||||||
|
filetransfer_ip=0.0.0.0
|
||||||
|
query_port=10011
|
||||||
|
query_ip=0.0.0.0
|
||||||
|
query_ip_whitelist=query_ip_whitelist.txt
|
||||||
|
query_ip_blacklist=query_ip_blacklist.txt
|
||||||
|
dbplugin=ts3db_sqlite3
|
||||||
|
dbpluginparameter=
|
||||||
|
dbsqlpath=/usr/local/teamspeak/sql/
|
||||||
|
dbsqlcreatepath=create_sqlite/
|
||||||
|
dbconnections=10
|
||||||
|
logpath=.
|
||||||
|
logquerycommands=0
|
||||||
|
dbclientkeepdays=30
|
||||||
|
logappend=1
|
103
teamspeak/manifests/init.pp
Normal file
103
teamspeak/manifests/init.pp
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
# Install TeamSpeak server.
|
||||||
|
#
|
||||||
|
# === Global variables
|
||||||
|
#
|
||||||
|
# $teamspeak_license:
|
||||||
|
# Teamspeak license file source.
|
||||||
|
#
|
||||||
|
class teamspeak {
|
||||||
|
|
||||||
|
if !$teamspeak_package {
|
||||||
|
case $architecture {
|
||||||
|
"x86_64": {
|
||||||
|
if $teamspeak64_package_latest {
|
||||||
|
$teamspeak_package = $teamspeak64_package_latest
|
||||||
|
} else {
|
||||||
|
fail("Must define \$teamspeak_package or \$teamspeak64_package_latest")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
if $teamspeak32_package_latest {
|
||||||
|
$teamspeak_package = $teamspeak32_package_latest
|
||||||
|
} else {
|
||||||
|
fail("Must define \$teamspeak_package or \$teamspeak32_package_latest")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
case $architecture {
|
||||||
|
"x86_64": {
|
||||||
|
$teamspeak_bin = "/usr/local/teamspeak/ts3server_linux_amd64"
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
$teamspeak_bin = "/usr/local/teamspeak/ts3server_linux_x86"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/usr/local/src/teamspeak3-server_linux.tar.gz":
|
||||||
|
ensure => present,
|
||||||
|
mode => "0644",
|
||||||
|
owner => "root",
|
||||||
|
group => "root",
|
||||||
|
source => "puppet:///files/packages/${teamspeak_package}",
|
||||||
|
}
|
||||||
|
util::extract::tar { "/usr/local/teamspeak":
|
||||||
|
strip => 1,
|
||||||
|
source => "/usr/local/src/teamspeak3-server_linux.tar.gz",
|
||||||
|
require => File["/usr/local/src/teamspeak3-server_linux.tar.gz"],
|
||||||
|
notify => Service["teamspeak"],
|
||||||
|
}
|
||||||
|
|
||||||
|
include user::system
|
||||||
|
realize(User["teamspeak"], Group["teamspeak"])
|
||||||
|
|
||||||
|
file { "/srv/teamspeak":
|
||||||
|
ensure => directory,
|
||||||
|
mode => "0700",
|
||||||
|
owner => "teamspeak",
|
||||||
|
group => "teamspeak",
|
||||||
|
require => User["teamspeak"],
|
||||||
|
}
|
||||||
|
file { "/srv/teamspeak/ts3server.ini":
|
||||||
|
ensure => present,
|
||||||
|
mode => "0600",
|
||||||
|
owner => "teamspeak",
|
||||||
|
group => "teamspeak",
|
||||||
|
source => "puppet:///modules/teamspeak/ts3server.ini",
|
||||||
|
require => File["/srv/teamspeak"],
|
||||||
|
notify => Service["teamspeak"],
|
||||||
|
}
|
||||||
|
|
||||||
|
if $teamspeak_license {
|
||||||
|
file { "/srv/teamspeak/licensekey.dat":
|
||||||
|
ensure => present,
|
||||||
|
mode => "0600",
|
||||||
|
owner => "teamspeak",
|
||||||
|
group => "teamspeak",
|
||||||
|
source => $teamspeak_license,
|
||||||
|
require => File["/srv/teamspeak"],
|
||||||
|
notify => Service["teamspeak"],
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/etc/init.d/teamspeak":
|
||||||
|
ensure => present,
|
||||||
|
mode => "0755",
|
||||||
|
owner => "root",
|
||||||
|
group => "root",
|
||||||
|
content => template("teamspeak/teamspeak.init.erb"),
|
||||||
|
notify => Exec["add-service-teamspeak"],
|
||||||
|
}
|
||||||
|
exec { "add-service-teamspeak":
|
||||||
|
path => "/bin:/usr/bin:/sbin:/usr/sbin",
|
||||||
|
command => "chkconfig --add teamspeak",
|
||||||
|
refreshonly => true,
|
||||||
|
before => Service["teamspeak"],
|
||||||
|
}
|
||||||
|
service { "teamspeak":
|
||||||
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
57
teamspeak/templates/teamspeak.init.erb
Normal file
57
teamspeak/templates/teamspeak.init.erb
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# chkconfig: 35 90 12
|
||||||
|
# description: TeamSpeak Service
|
||||||
|
# processname: teamspeak
|
||||||
|
|
||||||
|
[ -f /etc/rc.d/init.d/functions ] || exit 0
|
||||||
|
. /etc/rc.d/init.d/functions
|
||||||
|
|
||||||
|
RETVAL=0
|
||||||
|
PROG="<%= teamspeak_bin %>"
|
||||||
|
ARGS="inifile=ts3server.ini"
|
||||||
|
|
||||||
|
start() {
|
||||||
|
echo -n "Starting TeamSpeak server: "
|
||||||
|
export LD_LIBRARY_PATH="/usr/local/teamspeak"
|
||||||
|
daemon --user teamspeak "cd /srv/teamspeak ; $PROG $ARGS >/dev/null &"
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/teamspeak
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
|
echo -n "Stopping TeamSpeak server: "
|
||||||
|
killproc $PROG
|
||||||
|
RETVAL=$?
|
||||||
|
echo
|
||||||
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/teamspeak
|
||||||
|
return $RETVAL
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
|
||||||
|
stop)
|
||||||
|
stop
|
||||||
|
;;
|
||||||
|
|
||||||
|
status)
|
||||||
|
status $PROG
|
||||||
|
;;
|
||||||
|
|
||||||
|
restart|reload|condrestart)
|
||||||
|
stop
|
||||||
|
sleep 2
|
||||||
|
start
|
||||||
|
;;
|
||||||
|
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|status|restart|reload|condrestart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $RETVAL
|
Loading…
Add table
Reference in a new issue