Allow removing openstackwatch

We don't use it anymore and removing it would be nice.

Change-Id: If4781b2d57445150ab6fdd80222112ccba654f20
This commit is contained in:
Monty Taylor 2017-09-19 12:19:42 -05:00 committed by Andreas Jaeger
parent dbfd559052
commit a06b1ae633

View File

@ -11,15 +11,16 @@ class jeepyb::openstackwatch(
$minute = '18', $minute = '18',
$mode = 'multiple', $mode = 'multiple',
$projects = [], $projects = [],
$ensure = present,
) { ) {
include ::jeepyb include ::jeepyb
group { 'openstackwatch': group { 'openstackwatch':
ensure => present, ensure => $ensure,
} }
user { 'openstackwatch': user { 'openstackwatch':
ensure => present, ensure => $ensure,
managehome => true, managehome => true,
comment => 'OpenStackWatch User', comment => 'OpenStackWatch User',
shell => '/bin/bash', shell => '/bin/bash',
@ -29,7 +30,7 @@ class jeepyb::openstackwatch(
if $swift_password != '' { if $swift_password != '' {
cron { 'openstackwatch': cron { 'openstackwatch':
ensure => present, ensure => $ensure,
command => '/usr/local/bin/openstackwatch /home/openstackwatch/openstackwatch.ini', command => '/usr/local/bin/openstackwatch /home/openstackwatch/openstackwatch.ini',
minute => $minute, minute => $minute,
hour => $hour, hour => $hour,
@ -43,7 +44,7 @@ class jeepyb::openstackwatch(
} }
file { '/home/openstackwatch/openstackwatch.ini': file { '/home/openstackwatch/openstackwatch.ini':
ensure => present, ensure => $ensure,
content => template('jeepyb/openstackwatch.ini.erb'), content => template('jeepyb/openstackwatch.ini.erb'),
owner => 'root', owner => 'root',
group => 'openstackwatch', group => 'openstackwatch',
@ -53,13 +54,19 @@ class jeepyb::openstackwatch(
if ! defined(Package['python-pyrss2gen']) { if ! defined(Package['python-pyrss2gen']) {
package { 'python-pyrss2gen': package { 'python-pyrss2gen':
ensure => present, ensure => $ensure,
} }
} }
if ($ensure == present) {
$latest = latest
} else {
$latest = absent
}
if ! defined(Package['python-swiftclient']) { if ! defined(Package['python-swiftclient']) {
package { 'python-swiftclient': package { 'python-swiftclient':
ensure => latest, ensure => $latest,
provider => openstack_pip, provider => openstack_pip,
require => Class['pip'], require => Class['pip'],
} }