From fafffb6547345fce1427732203f0a996e7265053 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Wed, 6 Mar 2013 13:12:20 -0800 Subject: [PATCH] Add devstack-gate-secure.conf. This file exists on the jenkins master but is not managed by puppet. Put it on the new devstack-launch slave, under puppet control. Rename the apikey hieradata variable that zuul uses to be more generic since the same key is used by multiple projects. Add the username portion of that to hiera as well to make the hieradata file more self-documenting and easier to maintain, even though it's not strictly secret. The new values have been added to hiera. Change-Id: I0af634d091577236a81feefddada63feacf3e2bc Reviewed-on: https://review.openstack.org/23740 Reviewed-by: Monty Taylor Reviewed-by: Clark Boylan Approved: Jeremy Stanley Reviewed-by: Jeremy Stanley Tested-by: Jenkins --- manifests/site.pp | 6 +++-- .../manifests/devstack_launch_slave.pp | 27 ++++++++++++++++++- .../templates/devstack-gate-secure.conf.erb | 4 +++ 3 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 modules/openstack_project/templates/devstack-gate-secure.conf.erb diff --git a/manifests/site.pp b/manifests/site.pp index e67e6e7f99..7dabc3a6f1 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -206,8 +206,8 @@ node 'zuul.openstack.org' { class { 'openstack_project::zuul': jenkins_host => 'jenkins.openstack.org', jenkins_url => 'https://jenkins.openstack.org', - jenkins_user => 'hudson-openstack', - jenkins_apikey => hiera('zuul_jenkins_apikey'), + jenkins_user => hiera('jenkins_api_user'), + jenkins_apikey => hiera('jenkins_api_key'), gerrit_server => 'review.openstack.org', gerrit_user => 'jenkins', zuul_ssh_private_key => hiera('jenkins_ssh_private_key_contents'), @@ -233,6 +233,8 @@ node /^ci-backup-.*\.openstack\.org$/ { node 'devstack-launch.slave.openstack.org' { class { 'openstack_project::devstack_launch_slave': + jenkins_api_user => hiera('jenkins_api_user'), + jenkins_api_key => hiera('jenkins_api_key') } } diff --git a/modules/openstack_project/manifests/devstack_launch_slave.pp b/modules/openstack_project/manifests/devstack_launch_slave.pp index c56404ac10..8d270fcf8d 100644 --- a/modules/openstack_project/manifests/devstack_launch_slave.pp +++ b/modules/openstack_project/manifests/devstack_launch_slave.pp @@ -1,6 +1,22 @@ -# == Class: openstack_project::devstack_launch_slave +# Copyright 2013 OpenStack Foundation # +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# Install a host that manages the devstack node pool. + class openstack_project::devstack_launch_slave ( + $jenkins_api_user, + $jenkins_api_key ) { class { 'openstack_project::slave': @@ -12,4 +28,13 @@ class openstack_project::devstack_launch_slave ( provider => pip, require => Class['pip'], } + + file { '/home/jenkins/devstack-gate-secure.conf': + ensure => present, + owner => 'jenkins', + group => 'jenkins', + mode => '0600', + content => template('openstack_project/devstack-gate-secure.erb'), + require => File['/home/jenkins'], + } } diff --git a/modules/openstack_project/templates/devstack-gate-secure.conf.erb b/modules/openstack_project/templates/devstack-gate-secure.conf.erb new file mode 100644 index 0000000000..3e88374008 --- /dev/null +++ b/modules/openstack_project/templates/devstack-gate-secure.conf.erb @@ -0,0 +1,4 @@ +[jenkins] +server=https://jenkins.openstack.org +user=<%= jenkins_api_user %> +apikey=<%= jenkins_api_key %>