Skip to content

Commit

Permalink
Decouple management of Apache virtual host
Browse files Browse the repository at this point in the history
This is a just a port of @alexharv074 suggested patch to properly allow
the user to manage the http configuration.

Issue: #31
  • Loading branch information
Julien Bonjean committed Apr 28, 2015
1 parent 711b0c1 commit f7e84fd
Showing 1 changed file with 27 additions and 27 deletions.
54 changes: 27 additions & 27 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -166,39 +166,39 @@
require => Package['nagios'],
}

# Set a default content template if no content/source is specified
if $apache_httpd_conf_source == undef {
if $apache_httpd_conf_content == undef {
$apache_httpd_conf_content_final = template("${module_name}/apache_httpd/httpd-nagios.conf.erb")
} else {
$apache_httpd_conf_content_final = $apache_httpd_conf_content
}
}
file { '/etc/httpd/conf.d/nagios.conf':
owner => 'root',
group => 'root',
mode => '0644',
content => $apache_httpd_conf_content_final,
source => $apache_httpd_conf_source,
notify => Service['httpd'],
require => Package['nagios'],
}
if $apache_httpd_htpasswd_source != false {
file { '/etc/nagios/.htpasswd':
owner => 'root',
group => 'apache',
mode => '0640',
source => $apache_httpd_htpasswd_source,
require => Package['nagios'],
}
}

if $apache_httpd {
class { '::apache_httpd':
ssl => $apache_httpd_ssl,
modules => $apache_httpd_modules,
keepalive => 'On',
}

# Set a default content template if no content/source is specified
if $apache_httpd_conf_source == undef {
if $apache_httpd_conf_content == undef {
$apache_httpd_conf_content_final = template("${module_name}/apache_httpd/httpd-nagios.conf.erb")
} else {
$apache_httpd_conf_content_final = $apache_httpd_conf_content
}
}
file { '/etc/httpd/conf.d/nagios.conf':
owner => 'root',
group => 'root',
mode => '0644',
content => $apache_httpd_conf_content_final,
source => $apache_httpd_conf_source,
notify => Service['httpd'],
require => Package['nagios'],
}
if $apache_httpd_htpasswd_source != false {
file { '/etc/nagios/.htpasswd':
owner => 'root',
group => 'apache',
mode => '0640',
source => $apache_httpd_htpasswd_source,
require => Package['nagios'],
}
}
}

if $php {
Expand Down

0 comments on commit f7e84fd

Please sign in to comment.