Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mumble to Pandora #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions manifests/nodes/pandora.geeksoc.org.pp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
class {'sudo':
sudoers => '%sysadmin-games',
}


# Roles
include global

#Mumble
include mumble
}
1 change: 1 addition & 0 deletions modules/mumble/.puppet-lint.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--no-class_inherits_from_params_class-check
38 changes: 38 additions & 0 deletions modules/mumble/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Deploying a fully functional mumble server using puppet.

Supported debian & centos OS

Depends on puppet-module iptables, available on puppetlabs forge or the inuits module on https://github.com/Inuits/puppet-module-library
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have this module added already? Will it interfere with any firewall rules we already have (not sure we actually have any though... ;)


Mumble version 1.2.3
http://mumble.sourceforge.net/Install_CentOS5

used files from;
http://sourceforge.net/projects/mumble/files/Mumble/1.2.3/murmur-static_x86-1.2.3.tar.bz2/download
ftp://rpmfind.net/linux/Mandriva/devel/cooker/x86_64/media/contrib/release/mumble-server-1.2.3-1-mdv2011.0.x86_64.rpm

Example of Vagrantfile which deploys 2 boxes, one centos and one debian like

Vagrant::Config.run do |config|
config.vm.define :centos do |centos_config|
centos_config.vm.box = "centos-6.2"
centos_config.vm.host_name = "mumble-centos"
centos_config.vm.forward_port 64738, 64738
centos_config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "site.pp"
puppet.module_path = "modules"
end
end
config.vm.define :debian do |debian_config|
debian_config.vm.box = "debian-6"
debian_config.vm.host_name = "mumble-debian"
#debian_config.vm.network :bridged, {:bridge => "em1"}
debian_config.vm.forward_port 64738, 64738
debian_config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "site.pp"
puppet.module_path = "modules"
end
end
end
11 changes: 11 additions & 0 deletions modules/mumble/manifests/config.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Class: mumble::config
#
# Class which configures the mumble service
class mumble::config {
file{'/etc/mumble-server.ini':
owner => 'root',
group => 'root',
replace => true,
content => template('mumble/mumble-server.erb'),
}
}
16 changes: 16 additions & 0 deletions modules/mumble/manifests/firewall.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Class: mumble::firewall
#
# Class which configures the iptables firewall
class mumble::firewall {
Firewall{
action => 'accept',
}
firewall{'020 mumble-server-tcp':
dport => $mumble::port,
proto => 'tcp',
}
firewall{'021 mumble-server-udp':
dport => $mumble::port,
proto => 'udp',
}
}
9 changes: 9 additions & 0 deletions modules/mumble/manifests/group.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Class: mumble::group
#
# Class which deploys the mumble group
class mumble::group {
group{'mumble-server':
ensure => 'present',
gid => '4000',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the assumption that GID 400 will be available? I can't recall what LDAP start allocating from (though I think it's higher)

}
}
25 changes: 25 additions & 0 deletions modules/mumble/manifests/init.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Class: mumble
#
# Initialization class for the mumble module
class mumble (
$package_name = $mumble::params::package_name,
$password = $mumble::params::password,
$port = $mumble::params::port,
$bandwidth = $mumble::params::bandwith,
$ice = undef,
$dbus = undef,
$motd = $mumble::params::motd,
) inherits mumble::params {

if $motd {
motd::register { 'mumble': }
}

include ::mumble::install
include ::mumble::config
include ::mumble::service

Class['::mumble::install'] ->
Class['::mumble::config'] ->
Class['::mumble::service']
}
14 changes: 14 additions & 0 deletions modules/mumble/manifests/install.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Class: mumble::install
#
# Class which installs the nececcary packages from the inuits repository
class mumble::install {
$_require = $::operatingsystem ? {
/(centos|redhat|fedora)/ => Yumrepo['inuits'],
default => undef,
}
package{$::mumble::package_name:
ensure => 'installed',
require => $_require,

}
}
16 changes: 16 additions & 0 deletions modules/mumble/manifests/iptables.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Class: mumble::iptables
#
# This class will configure the firewall
class mumble::iptables {
if ! defined(Class['::iptables']) {
include ::iptables
}
iptables::rule{'mumble-server-tcp':
dport => $mumble::port,
proto => 'tcp',
}
iptables::rule{'mumble-server-udp':
dport => $mumble::port,
proto => 'udp',
}
}
11 changes: 11 additions & 0 deletions modules/mumble/manifests/params.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Class mumble::params
#
# This class contains every parameter which will be used in this puppet module
# for setting up a mumble voip server
class mumble::params {
$package_name = 'mumble-server'
$password = ''
$port = '64738'
$bandwidth = '72000'
$motd = false
}
11 changes: 11 additions & 0 deletions modules/mumble/manifests/service.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Class: mumble::service
#
# Class which ensures the mumble services is running
class mumble::service {
service{'mumble-server':
ensure => 'running',
hasstatus => true,
enable => true,
require => File['/etc/mumble-server.ini'],
}
}
10 changes: 10 additions & 0 deletions modules/mumble/manifests/user.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Class: mumble::user
#
# Class which deploys the mumble-server user
class mumble::user {
user{'mumble-server':
ensure => 'present',
gid => '4000',
shell => '/sbin/nologin';
}
}
91 changes: 91 additions & 0 deletions modules/mumble/templates/mumble-server.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# To enable username registration through
# http://webserver/cgi-bin/mumble-server/register.cgi
# then this value must be set to a valid email
# and you must be running a SMTP server on this
# machine.
#emailfrom =

# How many login attempts do we tolerate from one IP
# inside a given timeframe before we ban the connection?
# Note that this is global (shared between all virtual servers), and that
# it counts both successfull and unsuccessfull connection attempts.
# Set either Attempts or Timeframe to 0 to disable.
#autobanAttempts = 10
#autobanTimeframe = 120
#autobanTime = 300

# The below will be used as defaults for new configured servers.
# If you're just running one server (the default), it's easier to
# configure it here than through DBus/SQL.
#
# Welcome message sent to users
welcometext="<br />Welcome to this server running <b>Murmur</b>.<br />Enjoy your stay!<br />"

# Port to bind TCP and UDP sockets to
port=<%= scope.lookupvar('mumble::port') %>

# Specific IP or hostname to bind to.
# If this is left blank (default), murmur will bind to all available addresses.
#host=

# Password to join server
serverpassword=<%= scope.lookupvar('mumble::password') %>

# Maximum bandwidth (in bytes per second) clients are allowed
# send speech at.
bandwidth=<%= scope.lookupvar('mumble::bandwidth') %>

# Maximum number of concurrent clients allowed.
users=100

# Murmur retains the per-server log entries in an internal database which
# allows it to be accessed over D-Bus.
# How many days should such entries be kept?
#logdays=31

# To enable public registration, the serverpassword must be blank, and this
# must all be filled out.
# The password here is used to create a registry for the server name; subsequent
# updates will need the same password. Don't loose your password.
# The URL is your own website, and only set the registerHostname for static IP
# addresses.
#
#registerName=Mumble Server
#registerPassword=secret
#registerUrl=http://mumble.sourceforge.net/
#registerHostname=

# If you have a proper SSL certificate, you can provide the filenames here.
#sslCert=
#sslKey=

# Path to database. If blank, will search for
# murmur.sqlite in default locations.
database=/var/lib/mumble-server/mumble-server.sqlite

# PIDfile to use
# Leave blank to place pidfile in current directory
pidfile=/var/run/mumble-server/mumble-server.pid

# Murmur defaults to not using D-Bus. If you wish to use dbus, please
# specify so here.
<% if scope.lookupvar('mumble::dbus') == true -%>
dbus=system
<% else -%>
#dbus=system
<% end -%>

# If you want to use ZeroC ICE to communicate with Murmur, you need
# to specify the endpoint to use. Since there is no authentication
# with ICE, you should only use it if you trust all the users who have
# shell access to your machine.
# Please see the ICE documentation on how to specify endpoints.
<% if scope.lookupvar('mumble::ice') == true -%>
ice="tcp -h 127.0.0.1 -p 6502"
<% else -%>
#ice="tcp -h 127.0.0.1 -p 6502"
<% end -%>

# Murmur default to logging to murmur.log. If you leave this blank,
# murmur will log to the console (linux) or through message boxes (win32).
logfile=/var/log/mumble-server/mumble-server.log
9 changes: 9 additions & 0 deletions spec/hosts/pandora_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require 'spec_helper'

describe 'pandora.geeksoc.org' do
let(:node) { 'pandora.geeksoc.org' }
let(:facts) { {:operatingsystem => 'Debian'} }

it { should compile }
it { should contain_service('mumble-server') }
end