Allow project website volume path to be overridden
We've created a /afs/.openstack.org/project/starlingx.io volume for starlingx to host specs and docs and whatever else. Currently they are trying to set up docs.starlingx.io as a vhost to serve docs. This Means the vhost name and volume path differ. Allow for specifying a volume name that is different than the volume path in this case. The idea here is to avoid needing to create separate afs volumes for different (but related) content. Change-Id: Iea6d38096f2b4c90feab56289003af29fd5c224d
This commit is contained in:
parent
5a85385c3c
commit
b7ff8d9c8c
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
define openstack_project::website (
|
define openstack_project::website (
|
||||||
$aliases = undef,
|
$aliases = undef,
|
||||||
|
$volume_name = undef,
|
||||||
$ssl_cert = undef,
|
$ssl_cert = undef,
|
||||||
$ssl_key = undef,
|
$ssl_key = undef,
|
||||||
$ssl_intermediate = undef,
|
$ssl_intermediate = undef,
|
||||||
@ -21,11 +22,17 @@ define openstack_project::website (
|
|||||||
) {
|
) {
|
||||||
|
|
||||||
$afs_root = '/afs/openstack.org/'
|
$afs_root = '/afs/openstack.org/'
|
||||||
|
if $volume_name == undef {
|
||||||
|
# Default to volume name matching vhost name
|
||||||
|
$volume_name_ = $name
|
||||||
|
} else {
|
||||||
|
$volume_name_ = $volume_name
|
||||||
|
}
|
||||||
|
|
||||||
::httpd::vhost { $name:
|
::httpd::vhost { $name:
|
||||||
serveraliases => $aliases,
|
serveraliases => $aliases,
|
||||||
port => 443, # Is required despite not being used.
|
port => 443, # Is required despite not being used.
|
||||||
docroot => "${afs_root}/project/${name}/www",
|
docroot => "${afs_root}/project/${volume_name_}/www",
|
||||||
priority => '50',
|
priority => '50',
|
||||||
template => $template,
|
template => $template,
|
||||||
require => [File["/etc/ssl/certs/${name}.pem"],
|
require => [File["/etc/ssl/certs/${name}.pem"],
|
||||||
|
Loading…
Reference in New Issue
Block a user