Install and use the Gerrit welcome-message keypair

Change-Id: I7c23112664e43713f8dfc4bd0e4b9aec46b71500
This commit is contained in:
Jeremy Stanley 2014-01-31 21:49:09 +00:00
parent 8e80f8355b
commit f20639a2be
4 changed files with 35 additions and 1 deletions

View File

@ -29,6 +29,8 @@ node 'review.openstack.org' {
ssh_rsa_pubkey_contents => hiera('gerrit_ssh_rsa_pubkey_contents'),
ssh_project_rsa_key_contents => hiera('gerrit_project_ssh_rsa_key_contents'),
ssh_project_rsa_pubkey_contents => hiera('gerrit_project_ssh_rsa_pubkey_contents'),
ssh_welcome_rsa_key_contents => hiera('welcome_message_gerrit_ssh_private_key'),
ssh_welcome_rsa_pubkey_contents => hiera('welcome_message_gerrit_ssh_public_key'),
lp_sync_consumer_key => hiera('gerrit_lp_consumer_key'),
lp_sync_token => hiera('gerrit_lp_access_token'),
lp_sync_secret => hiera('gerrit_lp_access_secret'),

View File

@ -22,6 +22,8 @@ class openstack_project::gerrit (
$ssh_rsa_pubkey_contents = '', # If left empty puppet will not create file.
$ssh_project_rsa_key_contents = '', # If left empty will not create file.
$ssh_project_rsa_pubkey_contents = '', # If left empty will not create file.
$ssh_welcome_rsa_key_contents='', # If left empty will not create file.
$ssh_welcome_rsa_pubkey_contents='', # If left empty will not create file.
$email = '',
$database_poollimit = '',
$container_heaplimit = '',
@ -292,6 +294,28 @@ class openstack_project::gerrit (
require => Class['::gerrit'],
}
if $ssh_welcome_rsa_key_contents != '' {
file { '/home/gerrit2/review_site/etc/ssh_welcome_rsa_key':
owner => 'gerrit2',
group => 'gerrit2',
mode => '0600',
content => $ssh_welcome_rsa_key_contents,
replace => true,
require => File['/home/gerrit2/review_site/etc']
}
}
if $ssh_welcome_rsa_pubkey_contents != '' {
file { '/home/gerrit2/review_site/etc/ssh_welcome_rsa_key.pub':
owner => 'gerrit2',
group => 'gerrit2',
mode => '0644',
content => $ssh_welcome_rsa_pubkey_contents,
replace => true,
require => File['/home/gerrit2/review_site/etc']
}
}
if ($projects_file != 'UNDEF') {
if ($replicate_local) {
file { $local_git_dir:

View File

@ -55,6 +55,9 @@ class openstack_project::review (
# manage-projects's user ssh key.
$ssh_project_rsa_key_contents='',
$ssh_project_rsa_pubkey_contents='',
# welcome-message's user ssh key.
$ssh_welcome_rsa_key_contents='',
$ssh_welcome_rsa_pubkey_contents='',
# To be renamed - they're now just launchpad creds, not lp_sync
$lp_sync_consumer_key='',
$lp_sync_token='',
@ -92,6 +95,8 @@ class openstack_project::review (
ssh_rsa_pubkey_contents => $ssh_rsa_pubkey_contents,
ssh_project_rsa_key_contents => $ssh_project_rsa_key_contents,
ssh_project_rsa_pubkey_contents => $ssh_project_rsa_pubkey_contents,
ssh_welcome_rsa_key_contents => $ssh_welcome_rsa_key_contents,
ssh_welcome_rsa_pubkey_contents => $ssh_welcome_rsa_pubkey_contents,
email => 'review@openstack.org',
# 1 + 100 + 9 + 2 + 2 + 25 = 139(rounded up)
database_poollimit => '150',

View File

@ -9,5 +9,8 @@ timeout -k 2m 10m /usr/local/bin/trivial-rebase \
--whitespace \
--private-key-path=<%= ssh_host_key %> \
--role-user=<%= trivial_rebase_role_id %> "$@"
<% if $ssh_welcome_rsa_key_contents != "" -%>
timeout -k 2m 10m /usr/local/bin/welcome-message patchset-created --dryrun \
welcome-message@review.openstack.org <%= welcome-message_gerrit_ssh_private_key %> "$@"
welcome-message@review.openstack.org \
/home/gerrit2/review_site/etc/ssh_welcome_rsa_key "$@"
<% end -%>