From 48b235fe27a8308e6b42c453a7c1c0e4ff71c1af Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Mon, 5 Aug 2013 10:38:59 -0700 Subject: [PATCH] Add Jenkins SSH key to proposal.slave. Proposal.slave.openstack.org is used to push change proposals into Gerrit. To do this the slave needs to have the Jenkins' private SSH key installed. Make it so. Change-Id: Id3106d3167da0569370000e3c1a724a88abbd245 --- manifests/site.pp | 7 ++++--- modules/openstack_project/manifests/proposal_slave.pp | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/manifests/site.pp b/manifests/site.pp index a90fda84a8..efbab24129 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -434,9 +434,10 @@ node 'devstack-launch02.slave.openstack.org' { node 'proposal.slave.openstack.org' { include openstack_project class { 'openstack_project::proposal_slave': - transifex_username => 'openstackjenkins', - transifex_password => hiera('transifex_password'), - jenkins_ssh_public_key => $openstack_project::jenkins_ssh_key, + transifex_username => 'openstackjenkins', + transifex_password => hiera('transifex_password'), + jenkins_ssh_public_key => $openstack_project::jenkins_ssh_key, + jenkins_ssh_private_key => hiera('jenkins_ssh_private_key_contents'), } } diff --git a/modules/openstack_project/manifests/proposal_slave.pp b/modules/openstack_project/manifests/proposal_slave.pp index 979205c87b..2153c9297a 100644 --- a/modules/openstack_project/manifests/proposal_slave.pp +++ b/modules/openstack_project/manifests/proposal_slave.pp @@ -5,6 +5,7 @@ # class openstack_project::proposal_slave ( $jenkins_ssh_public_key, + $jenkins_ssh_private_key, $transifex_password = '', $transifex_username = 'openstackci', ) { @@ -27,4 +28,12 @@ class openstack_project::proposal_slave ( content => template('openstack_project/transifexrc.erb'), require => User['jenkins'], } + + file { '/home/jenkins/.ssh/id_rsa': + owner => 'jenkins', + group => 'jenkins', + mode => '0400', + require => File['/home/jenkins/.ssh'], + content => $jenkins_ssh_private_key, + } }