diff --git a/manifests/site.pp b/manifests/site.pp index e0f0d4fea1..3cf24f864a 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -407,7 +407,13 @@ node 'storyboard.openstack.org' { # A machine to serve static content. node 'static.openstack.org' { 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', } } diff --git a/modules/openstack_project/manifests/static.pp b/modules/openstack_project/manifests/static.pp index 157d9c3ecb..07cf01663a 100644 --- a/modules/openstack_project/manifests/static.pp +++ b/modules/openstack_project/manifests/static.pp @@ -2,6 +2,12 @@ # class openstack_project::static ( $sysadmins = [], + $swift_authurl = '', + $swift_user = '', + $swift_key = '', + $swift_tenant_name = '', + $swift_region_name = '', + $swift_default_container = '', ) { class { 'openstack_project::server': @@ -115,6 +121,23 @@ class openstack_project::static ( 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': ensure => directory, recurse => true, diff --git a/modules/openstack_project/templates/os-loganalyze-wsgi.conf.erb b/modules/openstack_project/templates/os-loganalyze-wsgi.conf.erb new file mode 100644 index 0000000000..f74fac5aaa --- /dev/null +++ b/modules/openstack_project/templates/os-loganalyze-wsgi.conf.erb @@ -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 -%> \ No newline at end of file