e04a26c7bb
This change fixes bug 1082754 and builds on the following prior work, which set up the underlying mechanisms and implemented them on review-dev: - https://review.openstack.org/12716 - https://review.openstack.org/13058 - https://review.openstack.org/13378 - https://review.openstack.org/13392 - https://review.openstack.org/13402 - https://review.openstack.org/13592 - https://review.openstack.org/14319 - https://review.openstack.org/14493 - https://review.openstack.org/16468 * manifests/site.pp(review.openstack.org): Add gerrit_contactstore_appsec and gerrit_contactstore_pubkey variables similar to those used for review-dev.openstack.org. * modules/openstack_project/manifests/gerrit.pp (openstack_project::gerrit): Move the cla_description, cla_file, cla_id and cla_name variables here, since they'll be used by both review and review-dev servers. Same goes for the set_agreements.sh file block and set_contributor_agreements exec block. Also stop loading the launchpad_sync module and make sure the sync_launchpad_users cron job is removed from the server. * modules/openstack_project/manifests/review.pp (openstack_project::review): Add the contactstore_appsec and contactstore_pubkey variables being from from hiera. Update the .war file to one with "Hack out some CLA bits" reverted. Turn on contactstore, pass the contactstore_appsec and contactstore_pubkey variables through, and set the production contactstore_url. * modules/openstack_project/manifests/review_dev.pp (openstack_project::review_dev): Remove the definitions for cla_description, cla_file, cla_id and cla_name, along with the set_agreements.sh file block and set_contributor_agreements exec block since they're all in gerrit.pp now. Change-Id: I037f1a3e2b03c66768cec6caa7fe5e1c68495ac6 Reviewed-on: https://review.openstack.org/14099 Reviewed-by: James E. Blair <corvus@inaugust.com> Reviewed-by: Monty Taylor <mordred@inaugust.com> Approved: Jeremy Stanley <fungi@yuggoth.org> Reviewed-by: Jeremy Stanley <fungi@yuggoth.org> Tested-by: Jenkins
126 lines
4.5 KiB
Puppet
126 lines
4.5 KiB
Puppet
# == Class: openstack_project::review_dev
|
|
#
|
|
class openstack_project::review_dev (
|
|
$github_oauth_token = '',
|
|
$github_project_username = '',
|
|
$github_project_password = '',
|
|
$mysql_password = '',
|
|
$mysql_root_password = '',
|
|
$email_private_key = '',
|
|
$contactstore_appsec = '',
|
|
$contactstore_pubkey = '',
|
|
$ssh_dsa_key_contents = '',
|
|
$ssh_dsa_pubkey_contents = '',
|
|
$ssh_rsa_key_contents = '',
|
|
$ssh_rsa_pubkey_contents = '',
|
|
$ssh_project_rsa_key_contents = '',
|
|
$ssh_project_rsa_pubkey_contents = '',
|
|
$lp_sync_key = '', # If left empty puppet will not create file.
|
|
$lp_sync_pubkey = '', # If left empty puppet will not create file.
|
|
$lp_sync_consumer_key = '',
|
|
$lp_sync_token = '',
|
|
$lp_sync_secret = '',
|
|
$replicate_github = true,
|
|
$sysadmins = []
|
|
) {
|
|
class { 'openstack_project::gerrit':
|
|
vhost_name => 'review-dev.openstack.org',
|
|
canonicalweburl => 'https://review-dev.openstack.org/',
|
|
ssl_cert_file => '/etc/ssl/certs/ssl-cert-snakeoil.pem',
|
|
ssl_key_file => '/etc/ssl/private/ssl-cert-snakeoil.key',
|
|
ssl_chain_file => '',
|
|
ssh_dsa_key_contents => $ssh_dsa_key_contents,
|
|
ssh_dsa_pubkey_contents => $ssh_dsa_pubkey_contents,
|
|
ssh_rsa_key_contents => $ssh_rsa_key_contents,
|
|
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,
|
|
email => 'review-dev@openstack.org',
|
|
war =>
|
|
'http://tarballs.openstack.org/ci/gerrit-2.4.2-16-g27644a5.war',
|
|
contactstore => true,
|
|
contactstore_appsec => $contactstore_appsec,
|
|
contactstore_pubkey => $contactstore_pubkey,
|
|
contactstore_url =>
|
|
'https://review-dev.openstack.org/fakestore',
|
|
script_user => 'launchpadsync',
|
|
script_key_file => '/home/gerrit2/.ssh/launchpadsync_rsa',
|
|
script_logging_conf => '/home/gerrit2/.sync_logging.conf',
|
|
projects_file =>
|
|
'openstack_project/review-dev.projects.yaml.erb',
|
|
github_username => 'openstack-gerrit-dev',
|
|
github_oauth_token => $github_oauth_token,
|
|
github_project_username => $github_project_username,
|
|
github_project_password => $github_project_password,
|
|
mysql_password => $mysql_password,
|
|
mysql_root_password => $mysql_root_password,
|
|
trivial_rebase_role_id =>
|
|
'trivial-rebase@review-dev.openstack.org',
|
|
email_private_key => $email_private_key,
|
|
replicate_github => $replicate_github,
|
|
sysadmins => $sysadmins,
|
|
}
|
|
|
|
file { '/var/log/gerrit_user_sync':
|
|
ensure => directory,
|
|
owner => 'root',
|
|
group => 'gerrit2',
|
|
mode => '0775',
|
|
require => User['gerrit2'],
|
|
}
|
|
file { '/home/gerrit2/.sync_logging.conf':
|
|
ensure => present,
|
|
owner => 'root',
|
|
group => 'gerrit2',
|
|
mode => '0644',
|
|
source =>
|
|
'puppet:///modules/openstack_project/gerrit/launchpad_sync_logging.conf',
|
|
require => User['gerrit2'],
|
|
}
|
|
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_lp_creds.erb'),
|
|
replace => true,
|
|
require => User['gerrit2'],
|
|
}
|
|
}
|