37e88867a8
Change-Id: I8facfa48113d27fd18e700730a7a27a666bc2c40 Reviewed-on: https://review.openstack.org/28059 Reviewed-by: Jesse Keating <jesse.keating@rackspace.com> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Khai Do <zaro0508@gmail.com> Approved: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Tested-by: Jenkins
120 lines
2.7 KiB
Puppet
120 lines
2.7 KiB
Puppet
define meetbot::site(
|
|
$channels,
|
|
$network,
|
|
$nick,
|
|
$nickpass,
|
|
$server,
|
|
$use_ssl,
|
|
$vhost_name = $::fqdn
|
|
) {
|
|
include remove_nginx
|
|
|
|
$varlib = "/var/lib/meetbot/${name}"
|
|
$meetbot = "/srv/meetbot-${name}"
|
|
|
|
apache::vhost { $vhost_name:
|
|
port => 80,
|
|
docroot => "/srv/meetbot-${name}",
|
|
priority => '50',
|
|
}
|
|
|
|
file { $varlib:
|
|
ensure => directory,
|
|
owner => 'meetbot',
|
|
require => File['/var/lib/meetbot'],
|
|
}
|
|
|
|
file { $meetbot:
|
|
ensure => directory,
|
|
}
|
|
|
|
file { "${meetbot}/index.html":
|
|
ensure => present,
|
|
content => template('meetbot/index.html.erb'),
|
|
require => File[$meetbot],
|
|
}
|
|
|
|
file { "${meetbot}/irclogs":
|
|
ensure => link,
|
|
target => "${varlib}/logs/ChannelLogger/${network}",
|
|
require => File[$meetbot],
|
|
}
|
|
|
|
file { "${meetbot}/meetings":
|
|
ensure => link,
|
|
target => "${varlib}/meetings",
|
|
require => File[$meetbot],
|
|
}
|
|
|
|
file { [
|
|
"${varlib}/conf",
|
|
"${varlib}/data",
|
|
"${varlib}/backup",
|
|
"${varlib}/logs"
|
|
]:
|
|
ensure => directory,
|
|
owner => 'meetbot',
|
|
require => File[$varlib],
|
|
}
|
|
|
|
file { "${varlib}/data/tmp":
|
|
ensure => directory,
|
|
owner => 'meetbot',
|
|
require => File["${varlib}/data"],
|
|
}
|
|
|
|
# set to root/root so meetbot doesn't overwrite
|
|
file { "${varlib}.conf":
|
|
ensure => present,
|
|
content => template('meetbot/supybot.conf.erb'),
|
|
group => 'root',
|
|
notify => Service["${name}-meetbot"],
|
|
owner => 'root',
|
|
require => File['/var/lib/meetbot'],
|
|
}
|
|
|
|
file { "${varlib}/ircmeeting":
|
|
ensure => directory,
|
|
owner => 'meetbot',
|
|
recurse => true,
|
|
require => [
|
|
Vcsrepo['/opt/meetbot'],
|
|
File[$varlib]
|
|
],
|
|
source => '/opt/meetbot/ircmeeting',
|
|
}
|
|
|
|
file { "${varlib}/ircmeeting/meetingLocalConfig.py":
|
|
ensure => present,
|
|
content => template('meetbot/meetingLocalConfig.py.erb'),
|
|
notify => Service["${name}-meetbot"],
|
|
owner => 'meetbot',
|
|
require => File["${varlib}/ircmeeting"],
|
|
}
|
|
|
|
# we set this file as root ownership because meetbot overwrites it on shutdown
|
|
# this means when puppet changes it and restarts meetbot the file is reset
|
|
file { "/etc/init/${name}-meetbot.conf":
|
|
ensure => present,
|
|
content => template('meetbot/upstart.erb'),
|
|
notify => Service["${name}-meetbot"],
|
|
owner => 'root',
|
|
replace => true,
|
|
require => File["${varlib}.conf"],
|
|
}
|
|
|
|
service { "${name}-meetbot":
|
|
provider => upstart,
|
|
require => [
|
|
Vcsrepo['/opt/meetbot'],
|
|
File["/etc/init/${name}-meetbot.conf"]
|
|
],
|
|
subscribe => [
|
|
File['/usr/share/pyshared/supybot/plugins/MeetBot'],
|
|
File["${varlib}/ircmeeting"]
|
|
],
|
|
}
|
|
}
|
|
|
|
# vim:sw=2:ts=2:expandtab:textwidth=79
|