520 lines
17 KiB
ObjectPascal
Raw Normal View History

# == Class: openstack_project::gerrit
#
# A wrapper class around the main gerrit class that sets gerrit
Implement Gerrit CLA and Contact Store. 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
2012-10-05 15:44:11 +00:00
# up for launchpad single sign on and bug/blueprint links
class openstack_project::gerrit (
$mysql_host,
$mysql_password,
$accountpatchreviewdb_url = undef,
$vhost_name = $::fqdn,
$canonicalweburl = "https://${::fqdn}/",
$git_http_url = '',
$canonical_git_url = '',
$serveradmin = 'webmaster@openstack.org',
$ssh_host_key = '/home/gerrit2/review_site/etc/ssh_host_rsa_key',
$ssh_project_key = '/home/gerrit2/review_site/etc/ssh_project_rsa_key',
$ssl_cert_file = "/etc/ssl/certs/${::fqdn}.pem",
$ssl_key_file = "/etc/ssl/private/${::fqdn}.key",
$ssl_chain_file = '/etc/ssl/certs/intermediate.pem',
$ssl_cert_file_contents = '',
$ssl_key_file_contents = '',
$ssl_chain_file_contents = '',
$ssh_dsa_key_contents = '', # If left empty puppet will not create file.
$ssh_dsa_pubkey_contents = '', # If left empty puppet will not create file.
$ssh_rsa_key_contents = '', # If left empty puppet will not create file.
$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.
$ssh_replication_rsa_key_contents='', # If left empty will not create file.
$ssh_replication_rsa_pubkey_contents='', # If left empty will not create file.
$email = '',
$database_poollimit = '',
$container_heaplimit = '',
$core_packedgitopenfiles = '',
$core_packedgitlimit = '',
$core_packedgitwindowsize = '',
$sshd_threads = '',
$httpd_acceptorthreads = '',
$httpd_minthreads = '',
$httpd_maxthreads = '',
$httpd_maxqueued = '',
$httpd_maxwait = '',
$war = '',
$acls_dir = 'UNDEF',
$notify_impact_file = 'UNDEF',
$projects_file = 'UNDEF',
$projects_config = 'UNDEF',
$github_username = '',
$github_oauth_token = '',
$github_project_username = '',
$github_project_password = '',
$email_private_key = '',
$token_private_key = '',
$replicate_local = true,
$replication_force_update = true,
$replication_auto_reload = false,
$replication = [],
$local_git_dir = '/opt/lib/git',
$jeepyb_cache_dir = '/opt/lib/jeepyb',
Implement Gerrit CLA and Contact Store. 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
2012-10-05 15:44:11 +00:00
$cla_description = 'OpenStack Individual Contributor License Agreement',
$cla_file = 'static/cla.html',
$cla_id = '2',
$cla_name = 'ICLA',
$testmode = false,
$swift_username = '',
$swift_password = '',
$gitweb = true,
$cgit = false,
$web_repo_url = false,
$web_repo_url_encode = false,
$secondary_index = true,
$report_bug_text = 'Get Help',
$report_bug_url = 'https://docs.openstack.org/infra/system-config/project.html#contributing',
$index_threads = 1,
$download = {},
$receive_max_object_size_limit = '100 m',
$cache_accounts = 32768,
$cache_accounts_byemail = 32768,
$cache_accounts_byname = 32768,
$cache_groups_byuuid = 32768,
$commentlinks = [],
$commitmessage_params = {},
$its_plugins = [],
$its_rules = [],
$java_home = '',
$openidssourl = 'https://login.ubuntu.com/+openid',
) {
class { 'jeepyb::openstackwatch':
projects => [
'openstack/ceilometer',
'openstack/cinder',
'openstack/glance',
'openstack/heat',
'openstack/horizon',
'openstack/infra',
'openstack/keystone',
'openstack/nova',
'openstack/oslo',
'openstack/neutron',
'openstack/swift',
'openstack/tempest',
'openstack-dev/devstack',
],
container => 'rss',
json_url => 'https://review.opendev.org/query?q=status:open',
swift_username => $swift_username,
swift_password => $swift_password,
swift_auth_url => 'https://auth.api.rackspacecloud.com/v1.0',
auth_version => '1.0',
}
class { '::gerrit':
vhost_name => $vhost_name,
canonicalweburl => $canonicalweburl,
git_http_url => $git_http_url,
canonical_git_url => $canonical_git_url,
# opinions
allow_drafts => false,
enable_melody => true,
melody_session => true,
robots_txt_source => 'puppet:///modules/openstack_project/gerrit/robots.txt',
enable_javamelody_top_menu => false,
# passthrough
java_home => $java_home,
ssl_cert_file => $ssl_cert_file,
ssl_key_file => $ssl_key_file,
ssl_chain_file => $ssl_chain_file,
ssl_cert_file_contents => $ssl_cert_file_contents,
ssl_key_file_contents => $ssl_key_file_contents,
ssl_chain_file_contents => $ssl_chain_file_contents,
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,
ssh_replication_rsa_key_contents => $ssh_replication_rsa_key_contents,
ssh_replication_rsa_pubkey_contents => $ssh_replication_rsa_pubkey_contents,
email => $email,
openidssourl => $openidssourl,
database_poollimit => $database_poollimit,
container_heaplimit => $container_heaplimit,
core_packedgitopenfiles => $core_packedgitopenfiles,
core_packedgitlimit => $core_packedgitlimit,
core_packedgitwindowsize => $core_packedgitwindowsize,
sshd_threads => $sshd_threads,
httpd_acceptorthreads => $httpd_acceptorthreads,
httpd_minthreads => $httpd_minthreads,
httpd_maxthreads => $httpd_maxthreads,
httpd_maxqueued => $httpd_maxqueued,
httpd_maxwait => $httpd_maxwait,
sshd_max_connections_per_user => '96',
commentlinks => $commentlinks,
its_plugins => $its_plugins,
its_rules => $its_rules,
trackingids => [
{
name => 'launchpad-bug',
footers => ['closes-bug:', 'partial-bug:', 'related-bug:'],
match => '\\\\#?(\\\\d+)',
system => 'Launchpad',
},
{
name => 'storyboard-story',
footer => 'story:',
match => '\\\\#?(\\\\d+)',
system => 'Storyboard',
},
{
name => 'storyboard-task',
footer => 'task:',
match => '\\\\#?(\\\\d+)',
system => 'Storyboard',
},
],
war => $war,
mysql_host => $mysql_host,
mysql_password => $mysql_password,
accountpatchreviewdb_url => $accountpatchreviewdb_url,
email_private_key => $email_private_key,
token_private_key => $token_private_key,
replicate_local => $replicate_local,
replicate_path => $local_git_dir,
replication_force_update => $replication_force_update,
replication_auto_reload => $replication_auto_reload,
replication => $replication,
gitweb => $gitweb,
cgit => $cgit,
web_repo_url => $web_repo_url,
web_repo_url_encode => $web_repo_url_encode,
testmode => $testmode,
secondary_index => $secondary_index,
require => Class[openstack_project::server],
report_bug_text => $report_bug_text,
report_bug_url => $report_bug_url,
index_threads => $index_threads,
download => $download,
receive_max_object_size_limit => $receive_max_object_size_limit,
commitmessage_params =>
{
maxLineLength => '72',
},
cache_accounts => $cache_accounts,
cache_accounts_byemail => $cache_accounts_byemail,
cache_accounts_byname => $cache_accounts_byname,
cache_groups_byuuid => $cache_groups_byuuid,
}
mysql_backup::backup_remote { 'gerrit':
database_host => $mysql_host,
database_user => 'gerrit2',
database_password => $mysql_password,
dest_dir => '/home/gerrit2/mysql_backups',
num_backups => '10',
require => Class['::gerrit'],
}
if ($testmode == false) {
class { 'gerrit::cron':
gitgc_repos => true,
}
class { 'github':
username => $github_username,
project_username => $github_project_username,
project_password => $github_project_password,
oauth_token => $github_oauth_token,
require => Class['::gerrit']
}
}
Enable Gerrit CLA and Contact Store on review-dev. This replaces the previous Echosign+Launchpad+Wiki+approver-based asynchronous contributor license agreement signing process with a fully-automated one contained entirely within Gerrit itself. Note that the CLA features in Gerrit's WebUI depend on a modified gerrit.war with an earlier patch reverted: https://review.openstack.org/12716 * manifests/site.pp(review-dev.openstack.org): Fill contactstore_appsec and contactstore_pubkey private material from hiera, for use by Gerrit's contact store feature. Similar entries should be added for review.openstack.org before going into production. * modules/gerrit/manifests/init.pp(gerrit): Add contactstore, contactstore_appsec and contactstore_url variables needed by the gerrit.config.erb template, and contactstore_pubkey needed by the contact_information.pub.erb template. Add a conditional block so that if contactstore is enabled it installs the libbcpg-java package which Bouncy Castle needs for OpenPGP operations, links the bcpg.jar into Gerrit's lib directory, and builds contact_information.pub from the contact_information.pub.erb template. * modules/gerrit/templates/contact_information.pub.erb: New template which is effectively an empty file waiting to be filled with the contents of the contactstore_pubkey variable. The gerrit_contact_information.pub file built from it gets used to encrypt contact information filed by users in such a way that it can only be decrypted by the private key held by the Foundation. * modules/gerrit/templates/gerrit.config.erb(contactstore): New section, implemented conditionally for safety. Once enabled, if the contactstore_appsec and contactstore_url are unset then Gerrit will refuse to start. If the system referred to by contactstore_url is unresponsive or contactstore_appsec does not contain the shared secret it's expecting, contributors will be unable to file initial or updated contact information through Gerrit's WebUI. * modules/openstack_project/files/gerrit/cla.html: A stripped-down HTML copy of http://wiki.openstack.org/CLA retaining all the original wording. This will probably need updating by OpenStack Foundation staff. * modules/openstack_project/manifests/gerrit.pp (openstack_project::gerrit): Add contactstore, contactstore_appsec, contactstore_pubkey and contactstore_url variables to pass back into the gerrit module. Also define the cla_description, cla_file, cla_id and cla_name variables which get used in the gerrit_set_agreements.sh.erb template. Add an entry to install the cla.html file. * modules/openstack_project/manifests/review_dev.pp (openstack_project::review_dev): Add the contactstore_appsec and contactstore_pubkey variables so they can be filled in by hiera. Override the war to pull in the g69c8fa6 test build which has the aforementioned CLA bits restored. Turn on contactstore and set contactstore_url to point to an existing test CGI on the Internet until the Foundation has theirs ready. Pass contactstore_appsec and contactstore_pubkey through up into gerrit.pp. Add an entry for the set_agreements.sh script built from the gerrit_set_agreements.sh.erb template and then execute it to add the new CLA to Gerrit's DB and mark the old one expired. Similar changes should be made in review.pp before going into production. * modules/openstack_project/templates/gerrit_set_agreements.sh.erb: New template used to build a set_agreements.sh script which checks Gerrit's database and, if necessary, expires the old Echosign CLA and adds the new local CLA. These conditions are checked and associated operations performed independently, so subsequent runs become a no-op. Post-migration, this can probably be neutered further and kept around for pushing future CLA modifications into the database when needed. Change-Id: Ib7136fef23dbd5602955649b33a57bc8d7106026 Reviewed-on: https://review.openstack.org/13058 Reviewed-by: Monty Taylor <mordred@inaugust.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Approved: Monty Taylor <mordred@inaugust.com> Tested-by: Jenkins
2012-09-15 00:51:25 +00:00
file { '/home/gerrit2/review_site/static/cla.html':
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
source => 'puppet:///modules/openstack_project/gerrit/cla.html',
replace => true,
Enable Gerrit CLA and Contact Store on review-dev. This replaces the previous Echosign+Launchpad+Wiki+approver-based asynchronous contributor license agreement signing process with a fully-automated one contained entirely within Gerrit itself. Note that the CLA features in Gerrit's WebUI depend on a modified gerrit.war with an earlier patch reverted: https://review.openstack.org/12716 * manifests/site.pp(review-dev.openstack.org): Fill contactstore_appsec and contactstore_pubkey private material from hiera, for use by Gerrit's contact store feature. Similar entries should be added for review.openstack.org before going into production. * modules/gerrit/manifests/init.pp(gerrit): Add contactstore, contactstore_appsec and contactstore_url variables needed by the gerrit.config.erb template, and contactstore_pubkey needed by the contact_information.pub.erb template. Add a conditional block so that if contactstore is enabled it installs the libbcpg-java package which Bouncy Castle needs for OpenPGP operations, links the bcpg.jar into Gerrit's lib directory, and builds contact_information.pub from the contact_information.pub.erb template. * modules/gerrit/templates/contact_information.pub.erb: New template which is effectively an empty file waiting to be filled with the contents of the contactstore_pubkey variable. The gerrit_contact_information.pub file built from it gets used to encrypt contact information filed by users in such a way that it can only be decrypted by the private key held by the Foundation. * modules/gerrit/templates/gerrit.config.erb(contactstore): New section, implemented conditionally for safety. Once enabled, if the contactstore_appsec and contactstore_url are unset then Gerrit will refuse to start. If the system referred to by contactstore_url is unresponsive or contactstore_appsec does not contain the shared secret it's expecting, contributors will be unable to file initial or updated contact information through Gerrit's WebUI. * modules/openstack_project/files/gerrit/cla.html: A stripped-down HTML copy of http://wiki.openstack.org/CLA retaining all the original wording. This will probably need updating by OpenStack Foundation staff. * modules/openstack_project/manifests/gerrit.pp (openstack_project::gerrit): Add contactstore, contactstore_appsec, contactstore_pubkey and contactstore_url variables to pass back into the gerrit module. Also define the cla_description, cla_file, cla_id and cla_name variables which get used in the gerrit_set_agreements.sh.erb template. Add an entry to install the cla.html file. * modules/openstack_project/manifests/review_dev.pp (openstack_project::review_dev): Add the contactstore_appsec and contactstore_pubkey variables so they can be filled in by hiera. Override the war to pull in the g69c8fa6 test build which has the aforementioned CLA bits restored. Turn on contactstore and set contactstore_url to point to an existing test CGI on the Internet until the Foundation has theirs ready. Pass contactstore_appsec and contactstore_pubkey through up into gerrit.pp. Add an entry for the set_agreements.sh script built from the gerrit_set_agreements.sh.erb template and then execute it to add the new CLA to Gerrit's DB and mark the old one expired. Similar changes should be made in review.pp before going into production. * modules/openstack_project/templates/gerrit_set_agreements.sh.erb: New template used to build a set_agreements.sh script which checks Gerrit's database and, if necessary, expires the old Echosign CLA and adds the new local CLA. These conditions are checked and associated operations performed independently, so subsequent runs become a no-op. Post-migration, this can probably be neutered further and kept around for pushing future CLA modifications into the database when needed. Change-Id: Ib7136fef23dbd5602955649b33a57bc8d7106026 Reviewed-on: https://review.openstack.org/13058 Reviewed-by: Monty Taylor <mordred@inaugust.com> Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Approved: Monty Taylor <mordred@inaugust.com> Tested-by: Jenkins
2012-09-15 00:51:25 +00:00
require => Class['::gerrit'],
}
file { '/home/gerrit2/review_site/static/usg-cla.html':
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
source => 'puppet:///modules/openstack_project/gerrit/usg-cla.html',
replace => true,
require => Class['::gerrit'],
}
file { '/home/gerrit2/review_site/static/system-cla.html':
ensure => present,
owner => 'root',
group => 'root',
mode => '0444',
source => 'puppet:///modules/openstack_project/gerrit/system-cla.html',
replace => true,
require => Class['::gerrit'],
}
file { '/home/gerrit2/review_site/static/title.svg':
ensure => present,
source => 'puppet:///modules/openstack_project/opendev.svg',
require => Class['::gerrit'],
notify => Exec['reload_gerrit_header'],
}
package { 'libjs-jquery':
ensure => present,
}
file { '/home/gerrit2/review_site/static/jquery.js':
ensure => present,
source => '/usr/share/javascript/jquery/jquery.js',
require => [
File['/home/gerrit2/review_site/static'],
Class['::gerrit'],
Package['libjs-jquery'],
],
subscribe => Package['libjs-jquery'],
notify => Exec['reload_gerrit_header'],
}
vcsrepo { '/opt/jquery-visibility':
ensure => latest,
provider => git,
revision => 'master',
source => 'https://github.com/mathiasbynens/jquery-visibility.git',
}
file { '/home/gerrit2/review_site/static/jquery-visibility.js':
ensure => present,
source => '/opt/jquery-visibility/jquery-visibility.js',
subscribe => Vcsrepo['/opt/jquery-visibility'],
notify => Exec['reload_gerrit_header'],
require => [ File['/home/gerrit2/review_site/static'],
Class['::gerrit'] ]
}
file { '/home/gerrit2/review_site/static/hideci.js':
ensure => present,
source => 'puppet:///modules/openstack_project/gerrit/hideci.js',
require => Class['::gerrit'],
notify => Exec['reload_gerrit_header'],
}
file { '/home/gerrit2/review_site/etc/GerritSite.css':
ensure => present,
source => 'puppet:///modules/openstack_project/gerrit/GerritSite.css',
require => Class['::gerrit'],
}
file { '/home/gerrit2/review_site/etc/GerritSiteHeader.html':
ensure => present,
source =>
'puppet:///modules/openstack_project/gerrit/GerritSiteHeader.html',
require => Class['::gerrit'],
}
exec { 'reload_gerrit_header':
command => 'sleep 10; touch /home/gerrit2/review_site/etc/GerritSiteHeader.html',
path => '/bin:/usr/bin',
refreshonly => true,
}
cron { 'gerritsyncusers':
ensure => absent,
}
Implement Gerrit CLA and Contact Store. 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
2012-10-05 15:44:11 +00:00
cron { 'sync_launchpad_users':
ensure => absent,
}
file { '/home/gerrit2/review_site/hooks/change-merged':
ensure => present,
owner => 'root',
group => 'root',
mode => '0555',
source => 'puppet:///modules/openstack_project/gerrit/change-merged',
replace => true,
require => Class['::gerrit'],
}
file { '/home/gerrit2/review_site/hooks/change-abandoned':
ensure => present,
owner => 'root',
group => 'root',
mode => '0555',
source => 'puppet:///modules/openstack_project/gerrit/change-abandoned',
replace => true,
require => Class['::gerrit'],
}
if ($notify_impact_file != 'UNDEF') {
file { '/home/gerrit2/review_site/hooks/notify_impact.yaml':
ensure => present,
source => $notify_impact_file,
require => Class['::gerrit'],
}
}
file { '/home/gerrit2/review_site/hooks/patchset-created':
ensure => present,
owner => 'root',
group => 'root',
mode => '0555',
Gerrit Trivial Rebase Detection Adds trivial_rebase.py for bug 881184. * modules/openstack_project/files/gerrit/scripts/trivial_rebase.py: A modified version of the contrib/trivial_rebase.py included in upstream Gerrit's git tree (we'll try to get individual patches submitted upstream soon): git clone https://gerrit.googlesource.com/gerrit * modules/openstack_project/files/gerrit/patchset-created: Moved to modules/openstack_project/templates/gerrit_patchset-created.erb and added an entry for the trivial_rebase.py script with variables for its command-line options sourced from gerrit.pp and review{,_dev}.pp. * modules/openstack_project/manifests/gerrit.pp: Changed the file definition for /home/gerrit2/review_site/hooks/patchset-created to use a template, adding the ssh_host_key and trivial_rebase_role_id variables it requires. Added a file entry for trivial_rebase.py as well, since we're putting it in modules/openstack_project instead of modules/gerrit where the existing scripts reside (we'll eventually want to move all of modules/gerrit/files/scripts out of there at some point, but not now). * modules/openstack_project/manifests/review_dev.pp: Override the trivial_rebase_role_id variable to trivial-rebase@review-dev.o.o on review-dev. * modules/openstack_project/manifests/review.pp: Override the trivial_rebase_role_id variable to trivial-rebase@review.o.o on review. Change-Id: I941f15525c72b84708ae1de6832834eb53ab6863 Reviewed-on: https://review.openstack.org/12373 Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
2012-09-05 17:17:53 +00:00
content => template('openstack_project/gerrit_patchset-created.erb'),
replace => true,
require => Class['::gerrit'],
Gerrit Trivial Rebase Detection Adds trivial_rebase.py for bug 881184. * modules/openstack_project/files/gerrit/scripts/trivial_rebase.py: A modified version of the contrib/trivial_rebase.py included in upstream Gerrit's git tree (we'll try to get individual patches submitted upstream soon): git clone https://gerrit.googlesource.com/gerrit * modules/openstack_project/files/gerrit/patchset-created: Moved to modules/openstack_project/templates/gerrit_patchset-created.erb and added an entry for the trivial_rebase.py script with variables for its command-line options sourced from gerrit.pp and review{,_dev}.pp. * modules/openstack_project/manifests/gerrit.pp: Changed the file definition for /home/gerrit2/review_site/hooks/patchset-created to use a template, adding the ssh_host_key and trivial_rebase_role_id variables it requires. Added a file entry for trivial_rebase.py as well, since we're putting it in modules/openstack_project instead of modules/gerrit where the existing scripts reside (we'll eventually want to move all of modules/gerrit/files/scripts out of there at some point, but not now). * modules/openstack_project/manifests/review_dev.pp: Override the trivial_rebase_role_id variable to trivial-rebase@review-dev.o.o on review-dev. * modules/openstack_project/manifests/review.pp: Override the trivial_rebase_role_id variable to trivial-rebase@review.o.o on review. Change-Id: I941f15525c72b84708ae1de6832834eb53ab6863 Reviewed-on: https://review.openstack.org/12373 Reviewed-by: Clark Boylan <clark.boylan@gmail.com> Reviewed-by: James E. Blair <corvus@inaugust.com> Approved: James E. Blair <corvus@inaugust.com> Tested-by: Jenkins
2012-09-05 17:17:53 +00:00
}
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) {
if (!defined(File[$local_git_dir])) {
file { $local_git_dir:
ensure => directory,
owner => 'gerrit2',
require => Class['::gerrit'],
}
cron { 'mirror_repack':
ensure => absent,
user => 'gerrit2',
}
cron { 'mirror_gitgc':
user => 'gerrit2',
weekday => '0',
hour => '4',
minute => '7',
command => "find ${local_git_dir} -type d -name \"*.git\" -print -exec git --git-dir=\"{}\" gc \\;",
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
}
}
}
file { '/home/gerrit2/projects.yaml':
ensure => present,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0444',
source => $projects_file,
replace => true,
require => Class['::gerrit'],
}
file { $jeepyb_cache_dir:
ensure => 'directory',
owner => 'gerrit2',
group => 'gerrit2',
mode => '0755',
}
file { '/home/gerrit2/projects.ini':
ensure => present,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0444',
content => template($projects_config),
replace => true,
require => Class['::gerrit'],
}
file { '/home/gerrit2/acls':
ensure => directory,
owner => 'gerrit2',
group => 'gerrit2',
mode => '0444',
recurse => true,
replace => true,
purge => true,
force => true,
source => $acls_dir,
require => Class['::gerrit']
}
if ($testmode == false) {
exec { 'manage_projects':
command => '/usr/local/bin/manage-projects -v -l /var/log/manage_projects.log',
timeout => 1800, # 30 minutes
subscribe => [
File['/home/gerrit2/projects.yaml'],
File['/home/gerrit2/acls'],
],
refreshonly => true,
logoutput => true,
require => [
File['/home/gerrit2/projects.yaml'],
File['/home/gerrit2/acls'],
Class['jeepyb'],
],
}
cron { 'track_upstream':
user => 'root',
hour => '*',
minute => '42',
command => '/usr/local/bin/track-upstream -v -l /var/log/track_upstream.log',
environment => 'PATH=/usr/bin:/bin:/usr/sbin:/sbin',
require => [
File['/home/gerrit2/projects.yaml'],
Class['jeepyb'],
],
}
include logrotate
logrotate::file { 'manage_projects.log':
log => '/var/log/manage_projects.log',
options => [
'compress',
'missingok',
'rotate 30',
'daily',
'notifempty',
'copytruncate',
],
require => Exec['manage_projects'],
}
logrotate::file { 'track_upstream.log':
log => '/var/log/track_upstream.log',
options => [
'compress',
'missingok',
'rotate 30',
'daily',
'notifempty',
'copytruncate',
],
require => Cron['track_upstream'],
}
}
}
Implement Gerrit CLA and Contact Store. 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
2012-10-05 15:44:11 +00:00
file { '/home/gerrit2/review_site/bin/set_agreements.sh':
ensure => absent,
Implement Gerrit CLA and Contact Store. 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
2012-10-05 15:44:11 +00:00
}
}