Add in wsgi.conf for os-loganalyze

Configure to use the read only swift creds that pair up with the read
write creds used to push the files.

Change-Id: I53252b3ed0d596b3fe36caef179f253bde1739cb
This commit is contained in:
Joshua Hesketh 2014-07-03 13:56:16 +10:00 committed by Clark Boylan
parent 5f8cb1d14c
commit df4f93b891
3 changed files with 40 additions and 1 deletions

View File

@ -407,7 +407,13 @@ node 'storyboard.openstack.org' {
# A machine to serve static content. # A machine to serve static content.
node 'static.openstack.org' { node 'static.openstack.org' {
class { 'openstack_project::static': class { 'openstack_project::static':
sysadmins => hiera('sysadmins', ['admin']), sysadmins => hiera('sysadmins', ['admin']),
swift_authurl => 'https://identity.api.rackspacecloud.com/v2.0/',
swift_user => 'infra-files-ro',
swift_key => hiera('infra_files_ro_password', 'XXX'),
swift_tenant_name => hiera('infra_files_tenant_name', 'tenantname'),
swift_region_name => 'DFW',
swift_default_container => 'infra-files',
} }
} }

View File

@ -2,6 +2,12 @@
# #
class openstack_project::static ( class openstack_project::static (
$sysadmins = [], $sysadmins = [],
$swift_authurl = '',
$swift_user = '',
$swift_key = '',
$swift_tenant_name = '',
$swift_region_name = '',
$swift_default_container = '',
) { ) {
class { 'openstack_project::server': class { 'openstack_project::server':
@ -115,6 +121,23 @@ class openstack_project::static (
subscribe => Vcsrepo['/opt/os-loganalyze'], subscribe => Vcsrepo['/opt/os-loganalyze'],
} }
file { '/etc/os_loganalyze':
ensure => directory,
owner => 'root',
group => 'root',
mode => '0755',
require => Vcsrepo['/opt/os-loganalyze'],
}
file { '/etc/os_loganalyze/wsgi.conf':
ensure => present,
owner => 'root',
group => 'www-data',
mode => '0440',
template => 'openstack_project/os-loganalyze-wsgi.conf.erb',
require => File['/etc/os_loganalyze'],
}
file { '/srv/static/logs/help': file { '/srv/static/logs/help':
ensure => directory, ensure => directory,
recurse => true, recurse => true,

View File

@ -0,0 +1,10 @@
<% if swift_authurl != "" -%>
[swift]
authurl=<%= swift_authurl %>
user=<%= swift_user %>
password=<%= swift_key %>
tenant=<%= swift_tenant_name %>
region=<%= swift_region_name %>
chunk_size=64
container=infra-files=<%= swift_default_container %>
<% end -%>