From 82acbd34be6dff77bbec95aa0cb3b7a80df4838a Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Sun, 31 Jul 2011 09:56:32 -0700 Subject: [PATCH] Added nginx config for doc server. Change-Id: I6552805a1b076625b435fbec0cfa697bbadb92db --- manifests/docs.pp | 24 ++-------------- modules/doc_server/manifests/init.pp | 38 ++++++++++++++++++++++++++ modules/doc_server/manifests/site.pp | 15 ++++++++++ modules/doc_server/templates/nginx.erb | 11 ++++++++ 4 files changed, 66 insertions(+), 22 deletions(-) create mode 100644 modules/doc_server/manifests/init.pp create mode 100644 modules/doc_server/manifests/site.pp create mode 100644 modules/doc_server/templates/nginx.erb diff --git a/manifests/docs.pp b/manifests/docs.pp index 6f985b2a13..85a3865a9c 100644 --- a/manifests/docs.pp +++ b/manifests/docs.pp @@ -1,27 +1,7 @@ import "openstack_ci_admins_users" -import "jenkins_slave" +import "doc_server" node default { include openstack_ci_admins_users - include jenkins_slave - - package { "python-storm": - ensure => present - } - - package { "python-mako": - ensure => present - } - - package { "python-pychart": - ensure => present - } - - package { "planet-venus": - ensure => present - } - - package { "nginx": - ensure => present - } + include doc_server } diff --git a/modules/doc_server/manifests/init.pp b/modules/doc_server/manifests/init.pp new file mode 100644 index 0000000000..e80c97e0c3 --- /dev/null +++ b/modules/doc_server/manifests/init.pp @@ -0,0 +1,38 @@ +import "jenkins_slave" + +class doc_server { + + include jenkins_slave + + package { 'nginx': + ensure => present; + } + + package { "python-storm": + ensure => present + } + + package { "python-mako": + ensure => present + } + + package { "python-pychart": + ensure => present + } + + package { "planet-venus": + ensure => present + } + + doc_server::site { "burrow": } + + doc_server::site { "ci": } + + doc_server::site { "keystone": } + + doc_server::site { "glance": } + + doc_server::site { "nova": } + + doc_server::site { "swift": } +} diff --git a/modules/doc_server/manifests/site.pp b/modules/doc_server/manifests/site.pp new file mode 100644 index 0000000000..ab8204cfe6 --- /dev/null +++ b/modules/doc_server/manifests/site.pp @@ -0,0 +1,15 @@ +define doc_server::site { + + file { "/etc/nginx/sites-available/${name}": + ensure => 'present', + content => template("doc_server/nginx.erb"), + replace => 'true', + require => Package[nginx], + } + + file { "/etc/nginx/sites-enabled/${name}": + ensure => link, + target => "/etc/nginx/sites-available/${name}", + require => Package[nginx], + } +} diff --git a/modules/doc_server/templates/nginx.erb b/modules/doc_server/templates/nginx.erb new file mode 100644 index 0000000000..53c50f2c4c --- /dev/null +++ b/modules/doc_server/templates/nginx.erb @@ -0,0 +1,11 @@ +server { + listen 80; + server_name <%= name %>.openstack.org; + DocumentRoot /srv/docs/<%= name %>; + Location ^~ /docs/ { + alias /srv/docs/<%= name %>/trunk; + } + Location ^~ /tarballs/ { + alias /srv/tarballs/<%= name %>; + } +}