some refactoring, externalizing classes
This commit is contained in:
38
manifests/puppet-dashboard.pp
Normal file
38
manifests/puppet-dashboard.pp
Normal file
@@ -0,0 +1,38 @@
|
||||
class puppet::puppet-dashboard ($ensure = "present") {
|
||||
require 'puppet::common'
|
||||
|
||||
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":
|
||||
key => "8347A27F",
|
||||
location => "http://apt.puppetlabs.com",
|
||||
repos => "main",
|
||||
ensure => 'absent',
|
||||
}
|
||||
|
||||
cron { "purge-reports":
|
||||
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",
|
||||
ensure => $ensure,
|
||||
}
|
||||
|
||||
cron { "purge-optimizedb":
|
||||
command => "cd /usr/share/puppet-dashboard && rake RAILS_ENV=production db:raw:optimize",
|
||||
user => "www-data",
|
||||
hour => "23",
|
||||
minute => "20",
|
||||
monthday => "*/10",
|
||||
ensure => $ensure,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user