From dbd4da09a7c92c783ed5a4b0a57e83f4989bc7ec Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Mon, 23 Jul 2012 20:09:17 -0500 Subject: [PATCH] Fix all of the gerrit module problems. Change-Id: I46001fd677bc9a3634c9860ec07438c326e908e3 --- modules/gerrit/manifests/init.pp | 2 +- modules/gerritbot/manifests/init.pp | 11 +++---- modules/github/manifests/init.pp | 2 +- modules/openstack_project/manifests/gerrit.pp | 30 ++++++------------- modules/openstack_project/manifests/review.pp | 9 +++--- .../templates/puppet.conf.erb | 18 +++++++++++ 6 files changed, 40 insertions(+), 32 deletions(-) create mode 100644 modules/openstack_project/templates/puppet.conf.erb diff --git a/modules/gerrit/manifests/init.pp b/modules/gerrit/manifests/init.pp index e283bd127c..8c38b44da6 100644 --- a/modules/gerrit/manifests/init.pp +++ b/modules/gerrit/manifests/init.pp @@ -51,7 +51,6 @@ class gerrit($virtual_hostname=$fqdn, $canonicalweburl="https://$fqdn/", - $canonicalweburl='', $ssl_cert_file='', $ssl_key_file='', $ssl_chain_file='', @@ -70,6 +69,7 @@ class gerrit($virtual_hostname=$fqdn, $commentlinks = [], $war, $script_user, + $script_site, $script_key_file, $enable_melody = 'false', $melody_session = 'false', diff --git a/modules/gerritbot/manifests/init.pp b/modules/gerritbot/manifests/init.pp index e5ab9abc52..89b488de5f 100644 --- a/modules/gerritbot/manifests/init.pp +++ b/modules/gerritbot/manifests/init.pp @@ -2,7 +2,8 @@ class gerritbot( $nick, $password, $server, - $user + $user, + $virtual_hostname ) { file { "/usr/local/gerrit/gerritbot": @@ -10,7 +11,7 @@ class gerritbot( group => 'root', mode => 555, ensure => 'present', - source => 'puppet:///modules/gerrit/gerritbot', + source => 'puppet:///modules/gerritbot/gerritbot', require => File['/usr/local/gerrit'], } @@ -19,7 +20,7 @@ class gerritbot( group => 'root', mode => 555, ensure => 'present', - source => 'puppet:///modules/gerrit/gerritbot.init', + source => 'puppet:///modules/gerritbot/gerritbot.init', require => File['/usr/local/gerrit/gerritbot'], } @@ -28,7 +29,7 @@ class gerritbot( group => 'gerrit2', mode => 440, ensure => 'present', - source => 'puppet:///modules/gerrit/gerritbot_channel_config.yaml', + source => 'puppet:///modules/gerritbot/gerritbot_channel_config.yaml', replace => true, require => User['gerrit2'], } @@ -48,7 +49,7 @@ class gerritbot( group => 'gerrit2', mode => 440, ensure => 'present', - content => template('gerrit/gerritbot.config.erb'), + content => template('gerritbot/gerritbot.config.erb'), replace => 'true', require => User['gerrit2'] } diff --git a/modules/github/manifests/init.pp b/modules/github/manifests/init.pp index a32ac233d1..d4bc3253ef 100644 --- a/modules/github/manifests/init.pp +++ b/modules/github/manifests/init.pp @@ -46,7 +46,7 @@ class github ( group => 'github', mode => 440, ensure => 'present', - content => template('gerrit/github.secure.config.erb'), + content => template('github/github.secure.config.erb'), replace => 'true', require => [Group['github'], File['/etc/github']], } diff --git a/modules/openstack_project/manifests/gerrit.pp b/modules/openstack_project/manifests/gerrit.pp index 7325a6151a..96e42969a1 100644 --- a/modules/openstack_project/manifests/gerrit.pp +++ b/modules/openstack_project/manifests/gerrit.pp @@ -101,50 +101,38 @@ class openstack_project::gerrit ( ensure => 'present', source => 'puppet:///modules/openstack_project/gerrit/echosign-cla.html', replace => 'true', - require => Class['gerrit::launchpad'], + require => Class['::gerrit'], } file { '/home/gerrit2/review_site/static/title.png': ensure => 'present', source => "puppet:///modules/openstack_project/openstack.png", - require => Class['gerrit::launchpad'], + require => Class['::gerrit'], } file { '/home/gerrit2/review_site/static/openstack-page-bkg.jpg': ensure => 'present', source => 'puppet:///modules/openstack_project/openstack-page-bkg.jpg', - require => Class['gerrit::launchpad'], + require => Class['::gerrit'], } file { '/home/gerrit2/review_site/etc/GerritSite.css': ensure => 'present', source => 'puppet:///modules/openstack_project/gerrit/GerritSite.css', - require => Class['gerrit::launchpad'], + require => Class['::gerrit'], } file { '/home/gerrit2/review_site/etc/GerritSiteHeader.html': ensure => 'present', - source => 'puppet:///modules/openstack_project/GerritSiteHeader.html', - require => Class['gerrit::launchpad'], + source => 'puppet:///modules/openstack_project/gerrit/GerritSiteHeader.html', + require => Class['::gerrit'], } cron { "gerritsyncusers": user => gerrit2, minute => "*/15", command => "sleep $((RANDOM\\%60+60)) && python /usr/local/gerrit/scripts/update_gerrit_users.py ${script_user} ${script_key_file} ${script_site}", - require => File['/usr/local/gerrit/scripts'], - } - - file { '/usr/local/gerrit/scripts': - owner => 'root', - group => 'root', - mode => 755, - ensure => 'directory', - recurse => true, - require => Class['gerrit'], - source => [ - "puppet:///modules/openstack_project/gerrit/scripts", - ], + require => Class['::gerrit'], } file { '/home/gerrit2/review_site/hooks/change-merged': @@ -154,7 +142,7 @@ class openstack_project::gerrit ( ensure => 'present', source => 'puppet:///modules/gerrit/change-merged', replace => 'true', - require => Class['gerrit'] + require => Class['::gerrit'] } file { '/home/gerrit2/review_site/hooks/patchset-created': @@ -164,6 +152,6 @@ class openstack_project::gerrit ( ensure => 'present', source => 'puppet:///modules/gerrit/patchset-created', replace => 'true', - require => Class['gerrit'] + require => Class['::gerrit'] } } diff --git a/modules/openstack_project/manifests/review.pp b/modules/openstack_project/manifests/review.pp index 87314b6245..652b5c43a1 100644 --- a/modules/openstack_project/manifests/review.pp +++ b/modules/openstack_project/manifests/review.pp @@ -48,10 +48,11 @@ class openstack_project::review { email_private_key => hiera('gerrit_email_private_key'), } class { 'gerritbot': - gerritbot_nick => 'openstackgerrit', - gerritbot_password => hiera('gerrit_gerritbot_password'), - gerritbot_server => 'irc.freenode.net', - gerritbot_user => 'gerritbot' + nick => 'openstackgerrit', + password => hiera('gerrit_gerritbot_password'), + server => 'irc.freenode.net', + user => 'gerritbot', + virtual_hostname => $fqdn } class { 'gerrit::remotes': upstream_projects => [ { diff --git a/modules/openstack_project/templates/puppet.conf.erb b/modules/openstack_project/templates/puppet.conf.erb new file mode 100644 index 0000000000..e306ac9752 --- /dev/null +++ b/modules/openstack_project/templates/puppet.conf.erb @@ -0,0 +1,18 @@ +[main] +logdir=/var/log/puppet +vardir=/var/lib/puppet +ssldir=/var/lib/puppet/ssl +rundir=/var/run/puppet +factpath=$vardir/lib/facter +templatedir=$confdir/templates +prerun_command=/etc/puppet/etckeeper-commit-pre +postrun_command=/etc/puppet/etckeeper-commit-post +server=ci-puppetmaster.openstack.org +certname=<%= fqdn %> + +[master] +# These are needed when the puppetmaster is run by passenger +# and can safely be removed if webrick is used. +ssl_client_header = SSL_CLIENT_S_DN +ssl_client_verify_header = SSL_CLIENT_VERIFY +