nagios: Update apache configuration to be generated.

Since this is basically just stock Apache configuration for Nagios
with a hostname put in, we can just fetch the hostname from our
configuration.
This commit is contained in:
Tim Abbott 2016-07-20 22:46:02 -07:00 committed by Tim Abbott
parent 3af01bed85
commit f2055397c1
3 changed files with 17 additions and 11 deletions

View File

@ -45,11 +45,10 @@ class zulip_ops::apache {
}
file { "/etc/apache2/sites-available/":
recurse => true,
ensure => directory,
require => Package[apache2],
owner => "root",
group => "root",
mode => 640,
source => "puppet:///modules/zulip_ops/apache/sites/",
}
}

View File

@ -134,5 +134,14 @@ class zulip_ops::nagios {
notify => Service["nagios3"],
}
file { "/etc/apache2/sites-available/nagios.conf":
recurse => true,
purge => false,
require => Package[apache2],
owner => "root",
group => "root",
mode => 640,
content => template("zulip_ops/nagios_apache_site.conf.template.erb"),
}
# TODO: Install our API
}

View File

@ -1,17 +1,15 @@
<VirtualHost *:80>
ServerName nagios.zulip.net
Redirect permanent / https://nagios.zulip.net/
ServerName nagios.<%= @hosts_domain %>
Redirect permanent / https://nagios.<%= @hosts_domain %>/
</VirtualHost>
<VirtualHost *:443>
ServerName nagios.zulip.net
ServerName nagios.<%= @hosts_domain %>
SSLEngine on
SSLCertificateFile /etc/ssl/certs/nagios.zulip.net.crt
SSLCertificateKeyFile /etc/ssl/private/nagios.key
SSLCertificateChainFile /etc/ssl/certs/sub.class1.server.ca.pem
SSLCACertificateFile /etc/ssl/certs/ca.pem
SSLCertificateFile /etc/letsencrypt/live/nagios.<%= @hosts_domain %>/cert.pem
SSLCertificateChainFile /etc/letsencrypt/live/nagios.<%= @hosts_domain %>/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nagios.<%= @hosts_domain %>/privkey.pem
Header add Strict-Transport-Security "max-age=15768000"
Header add X-Frame-Options DENY
@ -25,7 +23,7 @@
# Where the HTML pages live
Alias /nagios3 /usr/share/nagios3/htdocs
RedirectMatch ^/?$ https://nagios.zulip.net/cgi-bin/nagios3/status.cgi?host=all
RedirectMatch ^/?$ https://nagios.<%= @hosts_domain %>/cgi-bin/nagios3/status.cgi?host=all
<Location "/">
AuthType Digest