Skip to content

Commit

Permalink
Check mw* servers directly for SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentIsai authored Oct 5, 2024
1 parent 2511a01 commit 340389a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions modules/monitoring/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@
$redirects = loadyaml('/etc/puppetlabs/puppet/ssl-cert/redirects.yaml')
$sslcerts = $ssl + $redirects

$servers = query_nodes('Class[Role::Mediawiki]')
.flatten()
.unique()
.sort()

file { '/etc/icinga2/conf.d/ssl.conf':
ensure => 'present',
content => template('monitoring/ssl.conf.erb'),
Expand Down
11 changes: 11 additions & 0 deletions modules/monitoring/templates/ssl.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ apply Service "m.miraheze.org - LetsEncrypt" {
assign where "sslchecks" in host.groups
}

<% @servers.each do |server| -%>
apply Service "<%= server %> SSL Check" {
import "generic-service"
check_command = "check_ssl_expire"
check_interval = 30m
notes_url = "https://meta.miraheze.org/wiki/Tech:Icinga/MediaWiki_Monitoring#SSL_Validity_Checks"
vars.host = "<%= server %>"
vars.time = "30"
assign where "sslchecks" in host.groups
}

<% @sslcerts.each_pair do | name, property | -%>
apply Service "<%= property['url'] %> - <%= property['ca'] %>" {
import "generic-service"
Expand Down

0 comments on commit 340389a

Please sign in to comment.