From c54b4f952eb7a8733a1eb7733f33c567893bc6c2 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 16 Apr 2014 09:50:14 -0700 Subject: [PATCH] Fixes to nodepool installation on jenkins-dev.o.o The patch to add nodepool to jenkins-dev (https://review.openstack.org/#/c/57333) did not work. There were a few issues with it: 1. jenkins-dev.pp was passing literal strings to the nodepool module, instead it should be passing in the variables. 2. jenkins-dev.pp was calling ::nodepool but puppet seems to think that it wants ::openstack_project::nodepool due to puppet's scoping weirdness :( 3. The script to build nodepool machines needed the jenkins_dev_ssh_key. Fixes to above issues: 1. This is trivial, just passed the variables thru instead of literal strings. 2. The nodepool.pp module is renamed to nodepool_prod.pp to prevent the scoping problem. 3. We use the dev jenkins ssh key with dev nodepool by allowing the nodepool module to pass arbitrary env settings through the defaults file. Change-Id: Id91053212f088079ff1b0f06ebdce5c381f5cd19 --- manifests/init.pp | 1 + templates/nodepool.default.erb | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index fadb0e7..a211509 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -27,6 +27,7 @@ class nodepool ( $vhost_name = 'nodepool.openstack.org', $image_log_document_root = '/var/log/nodepool/image', $enable_image_log_via_http = false, + $environment = {}, ) { class { 'mysql::server': diff --git a/templates/nodepool.default.erb b/templates/nodepool.default.erb index 657027e..a0be88d 100644 --- a/templates/nodepool.default.erb +++ b/templates/nodepool.default.erb @@ -1,6 +1,8 @@ -<% if scope.lookupvar("nodepool::statsd_host") != "" %> +<% if scope.lookupvar("nodepool::statsd_host") != "" -%> export STATSD_HOST=<%= scope.lookupvar("nodepool::statsd_host") %> export STATSD_PORT=8125 -<% end %> +<% end -%> +<% scope.lookupvar("nodepool::environment").keys.sort.each do |key| -%> +export <%= key %>='<%= scope.lookupvar("nodepool::environment")[key] %>' +<% end -%> DAEMON_ARGS="-c /etc/nodepool/nodepool.yaml -l /etc/nodepool/logging.conf" -