system-config/modules/gerritbot/manifests/init.pp
Clark Boylan 00623af0c4 Ensure gerritbot is present and not latest.
Pip doesn't appear to be able to do a clean upgrade of gerritbot on
oneiric. It should remove the old versions of gerritbot after installing
the new versions but it does not. This confuses Puppet into thinking
that it need to reinstall gerritbot 0.1.2 on each puppet run which
restarts the IRC bot. To prevent this behavior ensure the package is
present and not latest.

Change-Id: I7729d126a7811b7e08541ed65ca48f4dc302ff6b
Reviewed-on: https://review.openstack.org/11955
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
2012-08-24 22:04:08 +00:00

79 lines
1.7 KiB
Puppet

class gerritbot(
$nick,
$password,
$server,
$user,
$vhost_name
) {
include pip
package { 'gerritbot':
ensure => present, # Pip upgrade is not working
provider => pip,
require => Class[pip]
}
file { '/etc/init.d/gerritbot':
owner => 'root',
group => 'root',
mode => 555,
ensure => 'present',
source => 'puppet:///modules/gerritbot/gerritbot.init',
require => Package['gerritbot'],
}
service { 'gerritbot':
name => 'gerritbot',
ensure => running,
enable => true,
hasrestart => true,
require => File['/etc/init.d/gerritbot'],
subscribe => [Package['gerritbot'],
File['/etc/gerritbot/gerritbot.config'],
File['/etc/gerritbot/channel_config.yaml']],
}
file { '/etc/gerritbot':
ensure => directory
}
file { '/var/log/gerritbot':
ensure => directory,
owner => 'root',
group => 'gerrit2',
mode => 0775,
}
file { '/etc/gerritbot/channel_config.yaml':
owner => 'root',
group => 'gerrit2',
mode => 440,
ensure => 'present',
source => 'puppet:///modules/gerritbot/gerritbot_channel_config.yaml',
replace => true,
require => User['gerrit2'],
}
file { '/etc/gerritbot/logging.config':
owner => 'root',
group => 'gerrit2',
mode => 440,
ensure => 'present',
source => 'puppet:///modules/gerritbot/logging.config',
replace => true,
require => User['gerrit2'],
}
file { '/etc/gerritbot/gerritbot.config':
owner => 'root',
group => 'gerrit2',
mode => 440,
ensure => 'present',
content => template('gerritbot/gerritbot.config.erb'),
replace => 'true',
require => User['gerrit2']
}
}