feat: auto restart puppetdb

- found several times the puppetdb service locks up after a week of active time
- restart the puppetdb nightly to prevent lock ups
This commit is contained in:
Ben Vincent 2024-08-06 22:43:07 +10:00
parent 2bda41712a
commit 0c44654a47

View File

@ -24,6 +24,19 @@ class profiles::puppet::puppetdb_api (
contain ::puppetdb::server 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': class { 'prometheus::puppetdb_exporter':
puppetdb_url => "http://${listen_address}:8080/pdb/query", puppetdb_url => "http://${listen_address}:8080/pdb/query",
export_scrape_job => true, export_scrape_job => true,