From 5dd484f1b2afc2dc9b81119da484081cc8c7811d Mon Sep 17 00:00:00 2001 From: Michael Krotscheck Date: Mon, 23 Feb 2015 13:08:51 -0800 Subject: [PATCH] Hostname and CORS domains are now configurable. Moved $hostname and $cors_allowed_origins into the top level module, so that they may be set on a per-host basis. Change-Id: I9859c903d0075493d230e433d68e0471f019140a --- manifests/site.pp | 5 +++++ modules/openstack_project/manifests/storyboard.pp | 11 +++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/manifests/site.pp b/manifests/site.pp index c194604f47..529a59b8d3 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -421,10 +421,15 @@ node 'storyboard.openstack.org' { ssl_cert_file_contents => hiera('storyboard_ssl_cert_file_contents', 'XXX'), ssl_key_file_contents => hiera('storyboard_ssl_key_file_contents', 'XXX'), ssl_chain_file_contents => hiera('storyboard_ssl_chain_file_contents', 'XXX'), + hostname => $::fqdn, valid_oauth_clients => [ $::fqdn, 'docs-draft.openstack.org', ], + cors_allowed_origins => [ + "https://${::fqdn}", + 'http://docs-draft.openstack.org', + ], } } diff --git a/modules/openstack_project/manifests/storyboard.pp b/modules/openstack_project/manifests/storyboard.pp index 51c434987b..5f9069a1c9 100644 --- a/modules/openstack_project/manifests/storyboard.pp +++ b/modules/openstack_project/manifests/storyboard.pp @@ -12,7 +12,9 @@ class openstack_project::storyboard( $ssl_chain_file_contents = undef, $openid_url = 'https://login.launchpad.net/+openid', $project_config_repo = '', - $valid_oauth_clients = [], + $hostname = $::fqdn, + $valid_oauth_clients = [$::fqdn], + $cors_allowed_origins = ["https://${::fqdn}"], ) { class { 'project_config': @@ -40,11 +42,8 @@ class openstack_project::storyboard( } class { '::storyboard::application': - hostname => $::fqdn, - cors_allowed_origins => [ - 'https://storyboard.openstack.org', - 'http://docs-draft.openstack.org', - ], + hostname => $hostname, + cors_allowed_origins => $cors_allowed_origins, valid_oauth_clients => $valid_oauth_clients, cors_max_age => 3600, openid_url => $openid_url,