Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update port management to work with mpm-itk

  • Loading branch information...
commit a7f61151ce964193063e11ccbe58e799f728e7e8 1 parent 9547673
@DavidS DavidS authored
Showing with 22 additions and 3 deletions.
  1. +21 −2 manifests/init.pp
  2. +1 −1  templates/munin-stats
View
23 manifests/init.pp
@@ -35,11 +35,13 @@
$apache_port_real = $apache_port ? { '' => 80, default => $apache_port }
+ apache::port { "apache_class": port => $apache_port_real }
+
# TODO: This has to be replaced by OS-specific configuration redirection
# into $modules_dir/apache
file {
"/etc/apache2/ports.conf":
- content => "Listen $apache_port_real\n",
+ content => "",
mode => 644, owner => root, group => root,
require => Package[apache],
notify => Exec["reload-apache"];
@@ -61,8 +63,11 @@
apache::module { "ssl": ensure => present }
$apache_ssl_port_real = $apache_ssl_port ? { '' => 443, default => $apache_ssl_port }
+
+ apache::port { "apache_ssl_class": port => $apache_ssl_port_real }
+
file { "/etc/apache2/conf.d/ssl_puppet":
- content => "Listen ${apache_ssl_port_real}\nSSLCertificateFile /var/lib/puppet/ssl/certs/${fqdn}.pem\nSSLCertificateKeyFile /var/lib/puppet/ssl/private_keys/${fqdn}.pem\n",
+ content => "SSLCertificateFile /var/lib/puppet/ssl/certs/${fqdn}.pem\nSSLCertificateKeyFile /var/lib/puppet/ssl/private_keys/${fqdn}.pem\n",
mode => 644, owner => root, group => root,
require => Package["apache"],
notify => Exec["reload-apache"],
@@ -89,6 +94,7 @@
# Monitoring stuff: munin and nagios
$real_munin_stats_port = $munin_stats_port ? { '' => 8666, default => $munin_stats_port }
+ apache::port { "apache::munin": port => $real_munin_stats_port }
package { "libwww-perl": ensure => installed }
apache::module { info: ensure => present }
apache::site { munin-stats: ensure => present, content => template("apache/munin-stats"), }
@@ -130,3 +136,16 @@
}
}
+# Create a Listen directive for apache in ports.conf
+# Use the $name to disambiguate between requests for the same port from
+# different modules
+define apache::port($port) {
+ line {
+ "apache::port::${name}":
+ file => "/etc/apache2/ports.conf",
+ line => "Listen ${port}",
+ ensure => present,
+ require => File["/etc/apache2/ports.conf"],
+ notify => Exec["reload-apache"];
+ }
+}
View
2  templates/munin-stats
@@ -1,7 +1,7 @@
# create a virtual host which provides statistics for munin
ExtendedStatus on
# hide this a little bit from "normal" accesses
-Listen <%= real_munin_stats_port %>
+#Listen <%= real_munin_stats_port %>
NameVirtualHost *:<%= real_munin_stats_port %>
<VirtualHost *:<%= real_munin_stats_port %>>
ServerName <%= hostname %>
Please sign in to comment.
Something went wrong with that request. Please try again.