Andrew Bogott has submitted this change and it was merged.

Change subject: Parameterize adminscripts class
......................................................................


Parameterize adminscripts class

This should increase the chances of novaenv.sh working
places other than virt1000.

Change-Id: I2508ef070dd8bcab98f9e8b6d28b092a1177250d
---
M manifests/role/nova.pp
M modules/openstack/manifests/adminscripts.pp
M modules/openstack/templates/novaenv.sh.erb
3 files changed, 9 insertions(+), 4 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/manifests/role/nova.pp b/manifests/role/nova.pp
index b62e6d0..5c70dc4 100644
--- a/manifests/role/nova.pp
+++ b/manifests/role/nova.pp
@@ -284,7 +284,9 @@
         class { 'role::puppet::server::labs': }
     }
 
-    include openstack::adminscripts
+    class { 'openstack::adminscripts':
+        novaconfig => $novaconfig
+    }
 }
 
 class role::nova::api {
diff --git a/modules/openstack/manifests/adminscripts.pp 
b/modules/openstack/manifests/adminscripts.pp
index fa5696c..56d7d93 100644
--- a/modules/openstack/manifests/adminscripts.pp
+++ b/modules/openstack/manifests/adminscripts.pp
@@ -1,6 +1,9 @@
-class openstack::adminscripts {
+class openstack::adminscripts(
+        $novaconfig) {
     include passwords::openstack::nova
     $wikitech_nova_ldap_user_pass = 
$passwords::openstack::nova::nova_ldap_user_pass
+    $nova_controller_hostname = $novaconfig["controller_hostname"]
+    $nova_region = $::site
 
     # Handy script to set up environment for commandline nova magic
     file { '/root/novaenv.sh':
diff --git a/modules/openstack/templates/novaenv.sh.erb 
b/modules/openstack/templates/novaenv.sh.erb
index 825c434..7adf2e1 100644
--- a/modules/openstack/templates/novaenv.sh.erb
+++ b/modules/openstack/templates/novaenv.sh.erb
@@ -1,6 +1,6 @@
 export OS_USERNAME="novaadmin"
 export OS_PASSWORD="<%= @wikitech_nova_ldap_user_pass %>"
-export OS_AUTH_URL="http://virt1000.wikimedia.org:35357/v2.0";
-export OS_REGION_NAME="eqiad"
+export OS_AUTH_URL="http://<%= @nova_controller_hostname %>:35357/v2.0"
+export OS_REGION_NAME="<%= @nova_region %>"
 export OS_TENANT_NAME="testlabs"
 export OS_NO_CACHE=1

-- 
To view, visit https://gerrit.wikimedia.org/r/169607
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2508ef070dd8bcab98f9e8b6d28b092a1177250d
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to