Created
March 26, 2012 03:46
-
-
Save garthk/2202745 to your computer and use it in GitHub Desktop.
bigbluebutton recipe for Puppet (requires manual fixup: see comments)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class bbb($bbb_hostname = $fqdn, $salt = "d34db33fba5eba11f01dab1e5ca1ab1e") { | |
exec { "dist upgrade": | |
refreshonly => true, | |
command => "/usr/bin/apt-get dist-upgrade", | |
} | |
exec { "update and dist upgrade": | |
refreshonly => true, | |
command => "/usr/bin/apt-get update", | |
notify => Exec["dist upgrade"], | |
} | |
apt::source { "bigbluebutton": | |
location => "http://ubuntu.bigbluebutton.org/lucid_dev_08/", | |
release => "bigbluebutton-lucid", | |
repos => "main", | |
key => "328BD16D", | |
key_source => "http://ubuntu.bigbluebutton.org/bigbluebutton.asc", | |
# pin => "-10", | |
include_src => false, | |
notify => Exec["update and dist upgrade"], | |
} | |
apt::source { "freeswitch": | |
location => "http://ppa.launchpad.net/freeswitch-drivers/freeswitch-nightly-drivers/ubuntu", | |
release => "lucid", | |
repos => "main", | |
key => "451AE93C", | |
key_server => "keyserver.ubuntu.com", | |
# pin => "-10", | |
include_src => false, | |
notify => Exec["update and dist upgrade"], | |
} | |
include fixedruby18 | |
include noapache2 | |
package { "bigbluebutton": | |
ensure => installed, | |
require => [ | |
Apt::Source["bigbluebutton"], | |
Apt::Source["freeswitch"], | |
Package["rubygems1.8"], | |
Exec["update_rubygems1.8"], | |
], | |
} | |
$propfile = "/var/lib/tomcat6/webapps/bigbluebutton/WEB-INF/classes/bigbluebutton.properties" | |
$serverURL = "http://${bbb_hostname}" | |
exec { "setsalt": | |
command => "/usr/local/bin/bbb-conf --setsalt ${salt}", | |
path => "/bin:/usr/bin", | |
onlyif => "test `grep securitySalt ${propfile}|cut -f 2 -d =` != ${salt}", | |
require => Package["bigbluebutton"], | |
notify => Exec['bbb-conf restart'], | |
} | |
exec { "setip": | |
command => "/usr/local/bin/bbb-conf --setip ${bbb_hostname}", | |
path => "/bin:/usr/bin", | |
onlyif => "test `grep ^bigbluebutton.web.serverURL ${propfile} | cut -f 2 -d =` != ${serverURL}", | |
require => Package["bigbluebutton"], | |
notify => Exec['bbb-conf restart'], | |
} | |
exec { "bbb-conf restart": | |
refreshonly => true, | |
command => "/usr/local/bin/bbb-conf --restart", | |
} | |
} | |
class bbb_demo(salt = "d34db33fba5eba11f01dab1e5ca1ab1e") { | |
Class['bbb'] -> Class['bbb_demo'] | |
file { "bbb_api_conf.jsp": | |
path => "/var/lib/tomcat6/webapps/demo/bbb_api_conf.jsp", | |
content => template("/etc/puppet/templates/bbb_api_conf.jsp.erb"), | |
# notify => Exec['bbb-conf restart'], | |
} | |
package { "bbb-demo": | |
ensure => installed, | |
require => Package["bigbluebutton"], | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%%! | |
// This is the security salt that must match the value set in the BigBlueButton server | |
String salt = "<%= salt %>"; | |
// This is the URL for the BigBlueButton server | |
<% if has_variable?("bbb_hostname") then %> | |
String BigBlueButtonURL = "http://<%= bbb_hostname %>/bigbluebutton/"; | |
<% else %> | |
String BigBlueButtonURL = "http://<%= fqdn %>/bigbluebutton/"; | |
<% end %> | |
%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/puppet/manifests/classes/fixedruby18.pp | |
# | |
# bigbluebutton can't install without a recent rubygems, with which Ubuntu 10.04 doesn't ship. | |
# This might be brittle due to requiring gem to be 1.x where x >=8; fix the test for points. | |
class fixedruby18 { | |
exec { "install_update_rubygems1.8": | |
command => "/usr/bin/gem1.8 install rubygems-update", | |
creates => "/var/lib/gems/1.8/bin/update_rubygems", | |
require => Package["rubygems1.8"], | |
} | |
exec { "update_rubygems1.8": | |
require => Exec["install_update_rubygems1.8"], | |
command => "/var/lib/gems/1.8/bin/update_rubygems", | |
onlyif => "test `gem1.8 -v | cut -f 1 -d .` -eq 1 -a `gem1.8 -v | cut -f 2 -d .` -lt 8", | |
path => "/usr/bin", | |
} | |
package { ["ruby1.8-dev", "rubygems1.8"]: | |
ensure => installed, | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/puppet/manifests/classes/noapache2.pp | |
# | |
# Removes apache2 from an Ubuntu server. | |
# Removal is sometimes not enough, hence the service definition. | |
class noapache2 { | |
package { 'apache2': | |
ensure => purged, | |
} | |
service { 'apache2': | |
ensure => stopped, | |
enable => false, | |
} | |
exec { 'autoremove': | |
command => '/usr/bin/apt-get autoremove --purge -y', | |
refreshonly => true, | |
subscribe => Package['apache2'], | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/puppet/manifests/nodes/bbbexample.pp | |
# | |
# Example node definition | |
# Please do NOT re-use salts! | |
node "bbb.example.com" { | |
$salt = "2eeaf32f1c117a7efd85719261f09cfe" | |
class { 'bbb': salt => $salt } | |
class { 'bbb_demo': salt => $salt } | |
} |
Fixed broken BigBlueButtonURL
in bbb_api_conf.jsp
. It might still be broken if $bbb_hostname != $fqdn
, but I'm back to a working configuration.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not quite yet working. On the first try, you'll get an error:
On re-running
apt-get dist-upgrade
, you'll see a more useful error message:Running
apt-get update -f
will finishapt-get dist-upgrade
's job, after which you can run Puppet again to complete the installation.It's not the one-run-install I want, but it's a start.