Split out meetbot module

The spec:
http://specs.openstack.org/openstack-infra/infra-specs/specs/puppet-modules.html

Depends-On: Ic0debfc11544f3f78d460727605886fb41c5820d
Change-Id: I0ca997a769027c767d9520b362cb041548c3777c
This commit is contained in:
Mikhail S Medvedev 2015-01-27 23:49:24 -06:00
parent 570abf2dce
commit 65a8f98b3a
8 changed files with 1 additions and 1649 deletions

View File

@ -60,6 +60,7 @@ INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-elasticsea
INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-storyboard"]="origin/master"
INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-kibana"]="origin/master"
INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-lodgeit"]="origin/master"
INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-meetbot"]="origin/master"
INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-jenkins"]="origin/master"
INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-pip"]="origin/master"
INTEGRATION_MODULES["https://git.openstack.org/openstack-infra/puppet-github"]="origin/master"

View File

@ -1,48 +0,0 @@
class meetbot {
include apache
vcsrepo { '/opt/meetbot':
ensure => latest,
provider => git,
source => 'https://git.openstack.org/openstack-infra/meetbot',
}
user { 'meetbot':
gid => 'meetbot',
home => '/var/lib/meetbot',
shell => '/sbin/nologin',
system => true,
require => Group['meetbot'],
}
group { 'meetbot':
ensure => present,
}
$packages = [
'supybot',
'python-twisted'
]
package { $packages:
ensure => present,
}
file { '/var/lib/meetbot':
ensure => directory,
owner => 'meetbot',
require => User['meetbot'],
}
file { '/usr/share/pyshared/supybot/plugins/MeetBot':
ensure => directory,
recurse => true,
require => [
Package['supybot'],
Vcsrepo['/opt/meetbot']
],
source => '/opt/meetbot/MeetBot',
}
}
# vim:sw=2:ts=2:expandtab:textwidth=79

View File

@ -1,120 +0,0 @@
define meetbot::site(
$channels,
$network,
$nick,
$nickpass,
$server,
$use_ssl,
$vhost_name = $::fqdn,
$vhost_extra = '',
) {
$varlib = "/var/lib/meetbot/${name}"
$meetbot = "/srv/meetbot-${name}"
apache::vhost { $vhost_name:
port => 80,
docroot => "/srv/meetbot-${name}",
priority => '50',
template => 'meetbot/vhost.erb',
}
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

View File

@ -1,16 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title><%= name.capitalize %> IRC log server</title>
</head>
<body>
<h1>Welcome to <%= name.capitalize %> IRC log server</h1>
<ul>
<li><a href="/irclogs/">Channel Logs</a></li>
<li><a href="/meetings/">Meeting Logs</a></li>
</ul>
</body>
</html>

View File

@ -1,5 +0,0 @@
class Config(object):
# These two are **required**:
logFileDir = '/var/lib/meetbot/<%= name %>/meetings/'
logUrlPrefix = 'http://<%= vhost_name %>/meetings/'
filenamePattern = '%(meetingname)s/%%Y/%(meetingname)s.%%F-%%H.%%M'

File diff suppressed because it is too large Load Diff

View File

@ -1,9 +0,0 @@
description "<%= name %> Meetbot Server"
author "Andrew Hutchings <andrew@linuxjedi.co.uk>"
start on (local-filesystem and net-device-up)
stop on runlevel [!2345]
env PYTHONPATH=/var/lib/meetbot/<%= name %>
exec start-stop-daemon --start --chdir /var/lib/meetbot/openstack --chuid meetbot --name meetbot --startas /usr/bin/python /usr/bin/supybot /var/lib/meetbot/<%= name %>.conf

View File

@ -1,31 +0,0 @@
# ************************************
# Managed by Puppet
# ************************************
NameVirtualHost <%= @vhost_name %>:<%= @port %>
<VirtualHost <%= @vhost_name %>:<%= @port %>>
ServerName <%= @srvname %>
<% if @serveraliases.is_a? Array -%>
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
<% elsif @serveraliases != '' -%>
<%= " ServerAlias #{@serveraliases}" %>
<% end -%>
DocumentRoot <%= @docroot %>
<FilesMatch \.log$>
ForceType text/plain
AddDefaultCharset UTF-8
</FilesMatch>
<Directory <%= @docroot %>>
Options <%= @options %>
AllowOverride None
Order allow,deny
allow from all
</Directory>
<%= @vhost_extra %>
ErrorLog /var/log/apache2/<%= @name %>_error.log
LogLevel warn
CustomLog /var/log/apache2/<%= @name %>_access.log combined
ServerSignature Off
</VirtualHost>