Split gerritbot into its own module.
Change-Id: Ia9034d87321624006ccf447b058ee828a97fcc7a
This commit is contained in:
parent
9b54f3d886
commit
e3e9aaba10
@ -46,7 +46,6 @@
|
|||||||
# Gerrit will be upgraded on the next puppet run.
|
# Gerrit will be upgraded on the next puppet run.
|
||||||
|
|
||||||
# TODO: move closing github pull requests to another module
|
# TODO: move closing github pull requests to another module
|
||||||
# TODO: move gerritbot configuration to another module
|
|
||||||
# TODO: move apache configuration to another module
|
# TODO: move apache configuration to another module
|
||||||
# TODO: move mysql configuration to another module
|
# TODO: move mysql configuration to another module
|
||||||
# TODO: make more gerrit options configurable here
|
# TODO: make more gerrit options configurable here
|
||||||
@ -90,10 +89,6 @@ class gerrit($virtual_hostname='',
|
|||||||
$script_site,
|
$script_site,
|
||||||
$enable_melody = 'false',
|
$enable_melody = 'false',
|
||||||
$melody_session = 'false',
|
$melody_session = 'false',
|
||||||
$gerritbot_nick,
|
|
||||||
$gerritbot_password,
|
|
||||||
$gerritbot_server,
|
|
||||||
$gerritbot_user,
|
|
||||||
$github_user,
|
$github_user,
|
||||||
$github_token,
|
$github_token,
|
||||||
$mysql_password,
|
$mysql_password,
|
||||||
@ -191,43 +186,6 @@ class gerrit($virtual_hostname='',
|
|||||||
require => File['/usr/local/gerrit/scripts'],
|
require => File['/usr/local/gerrit/scripts'],
|
||||||
}
|
}
|
||||||
|
|
||||||
file { "/usr/local/gerrit/gerritbot":
|
|
||||||
owner => 'root',
|
|
||||||
group => 'root',
|
|
||||||
mode => 555,
|
|
||||||
ensure => 'present',
|
|
||||||
source => 'puppet:///modules/gerrit/gerritbot',
|
|
||||||
}
|
|
||||||
|
|
||||||
file { "/etc/init.d/gerritbot":
|
|
||||||
owner => 'root',
|
|
||||||
group => 'root',
|
|
||||||
mode => 555,
|
|
||||||
ensure => 'present',
|
|
||||||
source => 'puppet:///modules/gerrit/gerritbot.init',
|
|
||||||
require => File['/usr/local/gerrit/gerritbot'],
|
|
||||||
}
|
|
||||||
|
|
||||||
file { "/home/gerrit2/gerritbot_channel_config.yaml":
|
|
||||||
owner => 'root',
|
|
||||||
group => 'gerrit2',
|
|
||||||
mode => 440,
|
|
||||||
ensure => 'present',
|
|
||||||
source => 'puppet:///modules/gerrit/gerritbot_channel_config.yaml',
|
|
||||||
replace => true,
|
|
||||||
require => User['gerrit2']
|
|
||||||
}
|
|
||||||
|
|
||||||
service { 'gerritbot':
|
|
||||||
name => 'gerritbot',
|
|
||||||
ensure => running,
|
|
||||||
enable => true,
|
|
||||||
hasrestart => true,
|
|
||||||
require => File['/etc/init.d/gerritbot'],
|
|
||||||
subscribe => [File["/usr/local/gerrit/gerritbot"],
|
|
||||||
File["/home/gerrit2/gerritbot_channel_config.yaml"]],
|
|
||||||
}
|
|
||||||
|
|
||||||
} # testmode==false
|
} # testmode==false
|
||||||
|
|
||||||
file { "/var/log/gerrit":
|
file { "/var/log/gerrit":
|
||||||
@ -376,16 +334,6 @@ class gerrit($virtual_hostname='',
|
|||||||
require => User['gerrit2']
|
require => User['gerrit2']
|
||||||
}
|
}
|
||||||
|
|
||||||
file { '/home/gerrit2/gerritbot.config':
|
|
||||||
owner => 'root',
|
|
||||||
group => 'gerrit2',
|
|
||||||
mode => 440,
|
|
||||||
ensure => 'present',
|
|
||||||
content => template('gerrit/gerritbot.config.erb'),
|
|
||||||
replace => 'true',
|
|
||||||
require => User['gerrit2']
|
|
||||||
}
|
|
||||||
|
|
||||||
# Gerrit sets these permissions in 'init'; don't fight them. If
|
# Gerrit sets these permissions in 'init'; don't fight them. If
|
||||||
# these permissions aren't set correctly, gerrit init will write a
|
# these permissions aren't set correctly, gerrit init will write a
|
||||||
# new secure.config file and lose the mysql password.
|
# new secure.config file and lose the mysql password.
|
||||||
|
56
modules/gerritbot/manifests/init.pp
Normal file
56
modules/gerritbot/manifests/init.pp
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
class gerritbot(
|
||||||
|
$nick,
|
||||||
|
$password,
|
||||||
|
$server,
|
||||||
|
$user
|
||||||
|
) {
|
||||||
|
|
||||||
|
file { "/usr/local/gerrit/gerritbot":
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => 555,
|
||||||
|
ensure => 'present',
|
||||||
|
source => 'puppet:///modules/gerrit/gerritbot',
|
||||||
|
require => File['/usr/local/gerrit'],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/etc/init.d/gerritbot":
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
mode => 555,
|
||||||
|
ensure => 'present',
|
||||||
|
source => 'puppet:///modules/gerrit/gerritbot.init',
|
||||||
|
require => File['/usr/local/gerrit/gerritbot'],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { "/home/gerrit2/gerritbot_channel_config.yaml":
|
||||||
|
owner => 'root',
|
||||||
|
group => 'gerrit2',
|
||||||
|
mode => 440,
|
||||||
|
ensure => 'present',
|
||||||
|
source => 'puppet:///modules/gerrit/gerritbot_channel_config.yaml',
|
||||||
|
replace => true,
|
||||||
|
require => User['gerrit2'],
|
||||||
|
}
|
||||||
|
|
||||||
|
service { 'gerritbot':
|
||||||
|
name => 'gerritbot',
|
||||||
|
ensure => running,
|
||||||
|
enable => true,
|
||||||
|
hasrestart => true,
|
||||||
|
require => File['/etc/init.d/gerritbot'],
|
||||||
|
subscribe => [File["/usr/local/gerrit/gerritbot"],
|
||||||
|
File["/home/gerrit2/gerritbot_channel_config.yaml"]],
|
||||||
|
}
|
||||||
|
|
||||||
|
file { '/home/gerrit2/gerritbot.config':
|
||||||
|
owner => 'root',
|
||||||
|
group => 'gerrit2',
|
||||||
|
mode => 440,
|
||||||
|
ensure => 'present',
|
||||||
|
content => template('gerrit/gerritbot.config.erb'),
|
||||||
|
replace => 'true',
|
||||||
|
require => User['gerrit2']
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,13 +1,13 @@
|
|||||||
[ircbot]
|
[ircbot]
|
||||||
nick=<%= gerritbot_nick %>
|
nick=<%= nick %>
|
||||||
pass=<%= gerritbot_password %>
|
pass=<%= password %>
|
||||||
server=<%= gerritbot_server %>
|
server=<%= server %>
|
||||||
port=6667
|
port=6667
|
||||||
channel_config=/home/gerrit2/gerritbot_channel_config.yaml
|
channel_config=/home/gerrit2/gerritbot_channel_config.yaml
|
||||||
lockfile=/var/run/gerritbot/gerritbot.pid
|
lockfile=/var/run/gerritbot/gerritbot.pid
|
||||||
|
|
||||||
[gerrit]
|
[gerrit]
|
||||||
user=<%= gerritbot_user %>
|
user=<%= user %>
|
||||||
key=/home/gerrit2/.ssh/gerritbot_rsa
|
key=/home/gerrit2/.ssh/gerritbot_rsa
|
||||||
host=<%= virtual_hostname %>
|
host=<%= virtual_hostname %>
|
||||||
port=29418
|
port=29418
|
@ -18,10 +18,6 @@ class openstack_project::gerrit (
|
|||||||
$war,
|
$war,
|
||||||
$script_user,
|
$script_user,
|
||||||
$script_key_file,
|
$script_key_file,
|
||||||
$gerritbot_nick='',
|
|
||||||
$gerritbot_password='',
|
|
||||||
$gerritbot_server='',
|
|
||||||
$gerritbot_user='',
|
|
||||||
$github_user,
|
$github_user,
|
||||||
$github_token,
|
$github_token,
|
||||||
$mysql_password,
|
$mysql_password,
|
||||||
@ -59,10 +55,6 @@ class openstack_project::gerrit (
|
|||||||
war => $war,
|
war => $war,
|
||||||
script_user => $script_user,
|
script_user => $script_user,
|
||||||
script_key_file => $script_key_file,
|
script_key_file => $script_key_file,
|
||||||
gerritbot_nick => $gerritbot_nick,
|
|
||||||
gerritbot_password => $gerritbot_password,
|
|
||||||
gerritbot_server => $gerritbot_server,
|
|
||||||
gerritbot_user => $gerritbot_user,
|
|
||||||
github_user => $github_user,
|
github_user => $github_user,
|
||||||
github_token => $github_token,
|
github_token => $github_token,
|
||||||
mysql_password => $mysql_password,
|
mysql_password => $mysql_password,
|
||||||
|
@ -45,13 +45,15 @@ class openstack_project::review {
|
|||||||
war => 'http://tarballs.openstack.org/ci/gerrit-2.4.1-10-g63110fd.war',
|
war => 'http://tarballs.openstack.org/ci/gerrit-2.4.1-10-g63110fd.war',
|
||||||
script_user => 'launchpadsync',
|
script_user => 'launchpadsync',
|
||||||
script_key_file => '/home/gerrit2/.ssh/launchpadsync_rsa',
|
script_key_file => '/home/gerrit2/.ssh/launchpadsync_rsa',
|
||||||
gerritbot_nick => 'openstackgerrit',
|
|
||||||
gerritbot_password => hiera('gerrit_gerritbot_password'),
|
|
||||||
gerritbot_server => 'irc.freenode.net',
|
|
||||||
gerritbot_user => 'gerritbot',
|
|
||||||
github_user => 'openstack-gerrit',
|
github_user => 'openstack-gerrit',
|
||||||
github_token => hiera('gerrit_github_token'),
|
github_token => hiera('gerrit_github_token'),
|
||||||
mysql_password => hiera('gerrit_mysql_password'),
|
mysql_password => hiera('gerrit_mysql_password'),
|
||||||
email_private_key => hiera('gerrit_email_private_key'),
|
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'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user