From ae2c27f2035921602609ba406a140488864775c3 Mon Sep 17 00:00:00 2001 From: Yolanda Robla Date: Fri, 6 Mar 2015 15:24:52 +0100 Subject: [PATCH] Add configurable url for OpenStack status Add the ability to set a configurable base status url and reuse it on status links. Change-Id: I326904dc4de24c9c7c01269b8e687ea928b43c5a --- modules/openstack_project/manifests/status.pp | 5 ++++- .../common.js => templates/status/common.js.erb} | 14 +++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) rename modules/openstack_project/{files/status/common.js => templates/status/common.js.erb} (84%) diff --git a/modules/openstack_project/manifests/status.pp b/modules/openstack_project/manifests/status.pp index 8923c0265b..41b8d5ff21 100644 --- a/modules/openstack_project/manifests/status.pp +++ b/modules/openstack_project/manifests/status.pp @@ -12,6 +12,8 @@ class openstack_project::status ( $recheck_ssh_private_key, $recheck_bot_passwd, $recheck_bot_nick, + $status_base_url = 'http://status.openstack.org/', + $status_title = 'OpenStack', ) { class { 'openstack_project::server': @@ -77,8 +79,9 @@ class openstack_project::status ( file { '/srv/static/status/common.js': ensure => present, - source => 'puppet:///modules/openstack_project/status/common.js', + content => template('openstack_project/status/common.js.erb'), require => File['/srv/static/status'], + replace => true, } file { '/srv/static/status/jquery.min.js': diff --git a/modules/openstack_project/files/status/common.js b/modules/openstack_project/templates/status/common.js.erb similarity index 84% rename from modules/openstack_project/files/status/common.js rename to modules/openstack_project/templates/status/common.js.erb index 2bfd4d0d3a..7fc954d05d 100644 --- a/modules/openstack_project/files/status/common.js +++ b/modules/openstack_project/templates/status/common.js.erb @@ -15,17 +15,17 @@ function header(activeTabName) { tabsName = new Array(); tabsLink = new Array(); - tabsName[0] = 'Status'; tabsLink[0] = 'http://status.openstack.org/'; - tabsName[1] = 'Zuul'; tabsLink[1] = 'http://status.openstack.org/zuul/'; - tabsName[2] = 'Rechecks'; tabsLink[2] = 'http://status.openstack.org/elastic-recheck/'; - tabsName[3] = 'Release'; tabsLink[3] = 'http://status.openstack.org/release/'; - tabsName[4] = 'Reviews'; tabsLink[4] = 'http://status.openstack.org/reviews/'; - tabsName[5] = 'Bugday'; tabsLink[5] = 'http://status.openstack.org/bugday/'; + tabsName[0] = 'Status'; tabsLink[0] = '<%= @status_base_url %>'; + tabsName[1] = 'Zuul'; tabsLink[1] = '<%= @status_base_url %>/zuul/'; + tabsName[2] = 'Rechecks'; tabsLink[2] = '<%= @status_base_url %>/elastic-recheck/'; + tabsName[3] = 'Release'; tabsLink[3] = '<%= @status_base_url %>/release/'; + tabsName[4] = 'Reviews'; tabsLink[4] = '<%= @status_base_url %>/reviews/'; + tabsName[5] = 'Bugday'; tabsLink[5] = '<%= @status_base_url %>/bugday/'; document.write( '