Added RabbitMQ to StoryBoard

In order to support subscriptions in StoryBoard, we're adding a
queueing system to support triggered events. The specification in
question is #95307, which goes into detail on the various different
options evaluated. I also anticipate that this system can be used
for report generation.

Change-Id: Ia4cc91f1e75365a9fb41ca163e55548023233412
Story: 96
This commit is contained in:
Michael Krotscheck 2014-08-13 08:33:59 -07:00
parent e4857b1a70
commit fb38fa63b3
6 changed files with 146 additions and 38 deletions

View File

@ -10,6 +10,7 @@ project_page 'https://github.com/openstack-ci/puppet-storyboard'
## Add dependencies, if any:
dependency 'puppetlabs/mysql', '= 0.6.1'
dependency 'puppetlabs/apache', '= 0.0.4'
dependency 'puppetlabs/rabbitmq', '= 4.0.0'
dependency 'example42/puppi', '= 2.1.9'
dependency 'openstackci/vcsrepo', '= 0.0.8'
dependency 'stankevich/python', '= 1.6.6'

View File

@ -28,22 +28,26 @@ A module that installs a standalone instance of StoryBoard.
The standalone StoryBoard module will install a fully functional, independent
instance of StoryBoard on your node. It includes a local instance of mysql,
an HTTPS vhost using the apache snakeoil certificates, and an automatic
redirect from http://$hostname to https://$hostname/.
RabbitMQ, an HTTPS vhost using the apache snakeoil certificates, and an
automatic redirect from http://$hostname to https://$hostname/.
node default {
class { 'storyboard':
mysql_database => 'storyboard',
mysql_user => 'storyboard',
mysql_user_password => 'changeme',
hostname => ::fqdn,
openid_url => 'https://login.launchpad.net/+openid',
ssl_cert_file => '/etc/ssl/certs/ssl-cert-snakeoil.pem',
ssl_cert_content => undef,
ssl_key_file => '/etc/ssl/private/ssl-cert-snakeoil.key',
ssl_key_content => undef,
ssl_ca_file => undef,
ssl_ca_content => undef
mysql_database => 'storyboard',
mysql_user => 'storyboard',
mysql_user_password => 'changeme',
rabbitmq_user => 'storyboard',
rabbitmq_user_password => 'changemetoo',
hostname => ::fqdn,
openid_url => 'https://login.launchpad.net/+openid',
ssl_cert_file => '/etc/ssl/certs/ssl-cert-snakeoil.pem',
ssl_cert_content => undef,
ssl_key_file => '/etc/ssl/private/ssl-cert-snakeoil.key',
ssl_key_content => undef,
ssl_ca_file => undef,
ssl_ca_content => undef
}
}
@ -111,14 +115,34 @@ and adjust the apache vhost accordingly.
hostname => ::fqdn,
# storyboard.conf parameters
access_token_ttl => 3600,
refresh_token_ttl => 604800,
openid_url => 'https://login.launchpad.net/+openid',
mysql_host => 'localhost',
mysql_port => 3306,
mysql_database => 'storyboard',
mysql_user => 'storyboard',
mysql_user_password => 'changeme'
access_token_ttl => 3600,
refresh_token_ttl => 604800,
openid_url => 'https://login.launchpad.net/+openid',
mysql_host => 'localhost',
mysql_port => 3306,
mysql_database => 'storyboard',
mysql_user => 'storyboard',
mysql_user_password => 'changeme',
rabbitmq_host => 'localhost',
rabbitmq_port => 5672,
rabbitmq_vhost => '/',
rabbitmq_user => 'storyboard',
rabbitmq_user_password => 'changemetoo'
}
}
## ::storyboard::rabbit
This module installs StoryBoard's RabbitMQ instance.
In order to handle subscriptions, emails, and reporting, storyboard uses
rabbitmq for deferred processing. This module installs a standalone, local
instance of rabbit.
node default {
class { 'storyboard::rabbit':
rabbitmq_user => 'storyboard',
rabbitmq_user_password => 'changeme'
}
}

View File

@ -21,19 +21,25 @@
class storyboard::application (
# Installation parameters
$www_root = '/var/lib/storyboard/www',
$server_admin = undef,
$hostname = $::fqdn,
$www_root = '/var/lib/storyboard/www',
$server_admin = undef,
$hostname = $::fqdn,
# storyboard.conf parameters
$access_token_ttl = 3600,
$refresh_token_ttl = 604800,
$access_token_ttl = 3600,
$refresh_token_ttl = 604800,
$openid_url,
$mysql_host = 'localhost',
$mysql_port = 3306,
$mysql_database = 'storyboard',
$mysql_user = 'storyboard',
$mysql_user_password = 'changeme',
$mysql_host = 'localhost',
$mysql_port = 3306,
$mysql_database = 'storyboard',
$mysql_user = 'storyboard',
$mysql_user_password = 'changeme',
$rabbitmq_host = 'localhost',
$rabbitmq_port = 5672,
$rabbitmq_vhost = '/',
$rabbitmq_user = 'storyboard',
$rabbitmq_user_password = 'changemetoo'
) {
# Dependencies

View File

@ -23,6 +23,10 @@ class storyboard (
$mysql_database = 'storyboard',
$mysql_user = 'storyboard',
$mysql_user_password = 'changeme',
$rabbitmq_user = 'storyboard',
$rabbitmq_user_password = 'changemetoo',
$hostname = $::fqdn,
$openid_url = 'https://login.launchpad.net/+openid',
@ -43,6 +47,11 @@ class storyboard (
ssl_ca_content => $ssl_ca_content,
}
class { '::storyboard::rabbit':
rabbitmq_user => $rabbitmq_user,
rabbitmq_user_password => $rabbitmq_user_password
}
class { '::storyboard::mysql':
mysql_database => $mysql_database,
mysql_user => $mysql_user,
@ -50,12 +59,15 @@ class storyboard (
}
class { '::storyboard::application':
hostname => $hostname,
openid_url => $openid_url,
mysql_host => 'localhost',
mysql_port => 3306,
mysql_database => $mysql_database,
mysql_user => $mysql_user,
mysql_user_password => $mysql_user_password,
hostname => $hostname,
openid_url => $openid_url,
mysql_host => 'localhost',
mysql_port => 3306,
mysql_database => $mysql_database,
mysql_user => $mysql_user,
mysql_user_password => $mysql_user_password,
rabbitmq_user => $rabbitmq_user,
rabbitmq_user_password => $rabbitmq_user_password
}
}

41
manifests/rabbit.pp Normal file
View File

@ -0,0 +1,41 @@
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# == Class: storyboard::rabbit
#
# The StoryBoard Rabbit manifest installs a standalone rabbitmq instance
# which is used to handle deferred processing and reporting tasks for
# StoryBoard.
#
class storyboard::rabbit (
$rabbitmq_user = 'storyboard',
$rabbitmq_user_password = 'changeme'
) {
class { 'rabbitmq':
service_manage => true,
delete_guest_user => true
}
rabbitmq_user { $rabbitmq_user:
password => $rabbitmq_user_password
}
rabbitmq_user_permissions { "${rabbitmq_user}@/":
configure_permission => '.*',
read_permission => '.*',
write_permission => '.*',
require => Rabbitmq_user[$rabbitmq_user]
}
}

View File

@ -46,6 +46,10 @@ refresh_token_ttl = <%= @refresh_token_ttl %>
# page_size_maximum = 500
# page_size_default = 20
# Enable notifications. This feature drives deferred processing, reporting,
# and subscriptions.
enable_notifications = True
[database]
# This line MUST be changed to actually run storyboard
# Example:
@ -85,3 +89,23 @@ connection=mysql://<%= @mysql_user %>:<%= @mysql_user_password %>@<%= @mysql_hos
# If set, use this value for pool_timeout with sqlalchemy
# pool_timeout = 10
[notifications]
# Host of the rabbitmq server.
rabbit_host=<%= @rabbitmq_host %>
# The RabbitMQ login method
rabbit_login_method = AMQPLAIN
# The RabbitMQ userid.
rabbit_userid = <%= @rabbitmq_user %>
# The RabbitMQ password.
rabbit_password = <%= @rabbitmq_user_password %>
# The RabbitMQ broker port where a single node is used.
rabbit_port = <%= @rabbitmq_port %>
# The virtual host within which our queues and exchanges live.
rabbit_virtual_host = <%= @rabbitmq_vhost %>