Skip to content

Commit

Permalink
Merge branch 'testing'
Browse files Browse the repository at this point in the history
  • Loading branch information
theseal committed Oct 21, 2024
2 parents 8ec2a1f + 2eb7b61 commit 3956dee
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 17 deletions.
3 changes: 2 additions & 1 deletion manifests/dehydrated/client_define.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@
minute => fqdn_rand(60),
}
} else {
$minute_random = String(fqdn_rand(60))
ensure_resource('sunet::scriptherder::cronjob', "dehydrated_fetch_${server}", {
cmd => "sh -c 'ssh -Ti \$HOME/.ssh/id_${_ssh_id} root@${server} | /bin/tar xvf - -C /etc/dehydrated/certs && /usr/bin/le-ssl-compat.sh'",
user => $user,
minute => '*/20',
minute => $minute_random,
ok_criteria => ['exit_status=0', 'max_age=2h'],
warn_criteria => ['exit_status=0', 'max_age=96h'],
})
Expand Down
12 changes: 7 additions & 5 deletions manifests/naemon_monitor.pp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
Optional[Boolean] $receive_otel = false,
String $otel_retention = '2232h',
) {
include sunet::systemd_reload

$naemon_container = $::facts['dockerhost2'] ? {
'yes' => 'naemon_monitor-naemon-1',
default => 'naemon_monitor_naemon_1',
Expand Down Expand Up @@ -105,6 +107,7 @@
ensure => file,
content => template('sunet/naemon_monitor/service-override.conf.erb'),
require => File['/etc/systemd/system/sunet-naemon_monitor.service.d/'],
notify => Class['sunet::systemd_reload'],
}

sunet::docker_compose { 'naemon_monitor':
Expand All @@ -116,13 +119,12 @@
require => File['/etc/systemd/system/sunet-naemon_monitor.service.d/override.conf'],
}


# This section can be removed when the class is run on all machines
file { '/opt/naemon_monitor/stop-monitor.sh':
ensure => file,
content => template('sunet/naemon_monitor/stop-monitor.sh.erb'),
mode => '0644',
group => 'root',
owner => 'root',
ensure => absent,
}
#

file { '/etc/logrotate.d/naemon_monitor':
ensure => file,
Expand Down
8 changes: 3 additions & 5 deletions templates/naemon_monitor/service-override.conf.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
[Service]
# Empty ExecStop from the main service file
ExecStop=
# Make sure that naemon has time to write down retention.dat
ExecStop=/opt/naemon_monitor/stop-monitor.sh
ExecReload=/usr/bin/docker exec <%= @naemon_container %> bash -c 'pkill -o naemon --signal HUP'
# livestatus.so can't handle HUP with a TCP listner
# https://github.com/naemon/naemon-livestatus/issues/117
ExecReload=/usr/bin/docker restart <%= @naemon_container %>
6 changes: 0 additions & 6 deletions templates/naemon_monitor/stop-monitor.sh.erb

This file was deleted.

0 comments on commit 3956dee

Please sign in to comment.