39 lines
1.0 KiB
Puppet
39 lines
1.0 KiB
Puppet
class puppet::puppet-dashboard ($ensure = 'present') {
|
|
require 'puppet::facter'
|
|
|
|
package { ['libjson-ruby', 'puppet-dashboard']:
|
|
ensure => $ensure,
|
|
require => Apt::Source['puppet-dashboard'],
|
|
}
|
|
|
|
if !defined(Class['puppet::puppetlabs_apt']) {
|
|
class { 'puppet::puppetlabs_apt': }
|
|
require 'puppet::puppetlabs_apt'
|
|
}
|
|
|
|
apt::source { 'puppet-dashboard':
|
|
ensure => 'absent',
|
|
key => '8347A27F',
|
|
location => 'http://apt.puppetlabs.com',
|
|
repos => 'main',
|
|
}
|
|
|
|
cron {
|
|
'purge-reports':
|
|
ensure => $ensure,
|
|
command => 'cd /usr/share/puppet-dashboard && rake RAILS_ENV=production reports:prune upto=14 unit=day',
|
|
user => 'www-data',
|
|
hour => '23',
|
|
minute => '2',
|
|
monthday => '*/14';
|
|
|
|
'purge-optimizedb':
|
|
ensure => $ensure,
|
|
command => 'cd /usr/share/puppet-dashboard && rake RAILS_ENV=production db:raw:optimize',
|
|
user => 'www-data',
|
|
hour => '23',
|
|
minute => '20',
|
|
monthday => '*/10',
|
|
}
|
|
}
|