Pass lp sync credentials in from hiera.

Pass review-dev's lp sync credentials in from hiera and ensure the
related files are created with the proper contents.

Change-Id: Ibe6cfb029245a29548d688efd5ea3c060c708256
Reviewed-on: https://review.openstack.org/14305
Reviewed-by: Monty Taylor <mordred@inaugust.com>
Approved: James E. Blair <corvus@inaugust.com>
Reviewed-by: James E. Blair <corvus@inaugust.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2012-10-10 12:14:51 -07:00 committed by Jenkins
parent 21dff1ba3d
commit 71c5e171b4
3 changed files with 60 additions and 0 deletions

View File

@ -33,6 +33,10 @@ node 'gerrit-dev.openstack.org', 'review-dev.openstack.org' {
email_private_key => hiera('gerrit_dev_email_private_key'), email_private_key => hiera('gerrit_dev_email_private_key'),
contactstore_appsec => hiera('gerrit_dev_contactstore_appsec'), contactstore_appsec => hiera('gerrit_dev_contactstore_appsec'),
contactstore_pubkey => hiera('gerrit_dev_contactstore_pubkey'), contactstore_pubkey => hiera('gerrit_dev_contactstore_pubkey'),
lp_sync_key => hiera('gerrit_dev_lp_sync_key'),
lp_sync_pubkey => hiera('gerrit_dev_lp_sync_pubkey'),
lp_sync_token => hiera('gerrit_dev_lp_access_token'),
lp_sync_secret => hiera('gerrit_dev_lp_access_secret'),
sysadmins => hiera('sysadmins'), sysadmins => hiera('sysadmins'),
} }
} }

View File

@ -9,6 +9,10 @@ class openstack_project::review_dev (
$cla_file='static/cla.html', $cla_file='static/cla.html',
$cla_id='2', $cla_id='2',
$cla_name='ICLA', $cla_name='ICLA',
$lp_sync_key='', # If left empty puppet will not create file.
$lp_sync_pubkey='', # If left empty puppet will not create file.
$lp_sync_token='',
$lp_sync_secret='',
$sysadmins = [] $sysadmins = []
) { ) {
class { 'openstack_project::gerrit': class { 'openstack_project::gerrit':
@ -60,6 +64,52 @@ class openstack_project::review_dev (
replace => 'true', replace => 'true',
require => Class['::gerrit'] require => Class['::gerrit']
} }
file { '/home/gerrit2/.ssh':
ensure => directory,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0700',
require => User['gerrit2'],
}
if $lp_sync_key != '' {
file { '/home/gerrit2/.ssh/launchpadsync_rsa':
ensure => present,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0600',
content => $lp_sync_key,
replace => true,
require => User['gerrit2'],
}
}
if $lp_sync_pubkey != '' {
file { '/home/gerrit2/.ssh/launchpadsync_rsa.pub':
ensure => present,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0644',
content => $lp_sync_pubkey,
replace => true,
require => User['gerrit2'],
}
}
file { '/home/gerrit2/.launchpadlib':
ensure => directory,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0775',
require => User['gerrit2'],
}
file { '/home/gerrit2/.launchpadlib/creds':
ensure => present,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0600',
content => template('openstack_project/gerrit_dev_lp_creds.erb'),
replace => true,
require => User['gerrit2'],
}
exec { 'set_contributor_agreements': exec { 'set_contributor_agreements':
path => ['/bin', '/usr/bin'], path => ['/bin', '/usr/bin'],
command => '/home/gerrit2/review_site/bin/set_agreements.sh', command => '/home/gerrit2/review_site/bin/set_agreements.sh',

View File

@ -0,0 +1,6 @@
[1]
consumer_key = System-wide: Ubuntu (gerrit-dev.openstack.org)
consumer_secret =
access_token = <%= lp_sync_token %>
access_secret = <%= lp_sync_secret %>