diff --git a/site/profiles/manifests/puppet/puppetdb_api.pp b/site/profiles/manifests/puppet/puppetdb_api.pp index 8c2177e..bdf7532 100644 --- a/site/profiles/manifests/puppet/puppetdb_api.pp +++ b/site/profiles/manifests/puppet/puppetdb_api.pp @@ -24,6 +24,19 @@ class profiles::puppet::puppetdb_api ( contain ::puppetdb::server + # generate the minute for the cron job using fqdn_rand + $random_minute = fqdn_rand(60) + + # create cron task to restart the puppetdb service daily at 3am + cron { 'restart_puppetdb': + ensure => 'present', + user => 'root', + command => '/bin/systemctl restart puppetdb', + minute => $random_minute, + hour => '3', + require => Service['puppetdb'], + } + class { 'prometheus::puppetdb_exporter': puppetdb_url => "http://${listen_address}:8080/pdb/query", export_scrape_job => true,