diff --git a/manifests/pnp4nagios.pp b/manifests/pnp4nagios.pp index 47d5fb35..a59f397e 100644 --- a/manifests/pnp4nagios.pp +++ b/manifests/pnp4nagios.pp @@ -5,14 +5,17 @@ $nagios_command_line = '/usr/libexec/pnp4nagios/process_perfdata.pl --bulk', $nagios_service_name = 'pnp4nagios-service', $nagios_service_action_url = '/pnp4nagios/index.php/graph?host=$HOSTNAME$&srv=$SERVICEDESC$', + $nagios_html_base_path = '/usr/share/nagios/html', $perflog = '/var/log/pnp4nagios/service-perfdata', # The apache config snippet $apache_httpd = true, $apache_httpd_conf_content = undef, $apache_httpd_conf_source = undef, $apache_httpd_conf_file = '/etc/httpd/conf.d/pnp4nagios.conf', + $apache_httpd_alias_path = '/pnp4nagios', # Other Boolean $selinux = true, + $html_base_path = '/usr/share/nagios/html/pnp4nagios', $ssi = false ) { @@ -70,9 +73,9 @@ # https://docs.pnp4nagios.org/pnp-0.6/webfe # Content from /usr/share/doc/pnp4nagios-0.6.25/contrib/ssi/status-header.ssi if $ssi { - file { '/usr/share/nagios/html/ssi/common-header.ssi': + file { "${nagios_html_base_path}/ssi/common-header.ssi": ensure => 'present', - source => "puppet:///modules/${module_name}/pnp4nagios/common-header.ssi", + content => template("${module_name}/pnp4nagios/common-header.ssi.erb"), require => Package['nagios'], } } diff --git a/templates/apache_httpd/httpd-pnp4nagios.conf.erb b/templates/apache_httpd/httpd-pnp4nagios.conf.erb index bfd6e298..173a1d8f 100644 --- a/templates/apache_httpd/httpd-pnp4nagios.conf.erb +++ b/templates/apache_httpd/httpd-pnp4nagios.conf.erb @@ -1,8 +1,8 @@ # SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER -Alias /pnp4nagios "/usr/share/nagios/html/pnp4nagios" +Alias <%= @apache_httpd_alias_path %> "<%= @html_base_path %>" - +"> AllowOverride None <% if !@apache_allowed_from.empty? -%> Order Deny,Allow diff --git a/templates/pnp4nagios/common-header.ssi.erb b/templates/pnp4nagios/common-header.ssi.erb new file mode 100644 index 00000000..8a38a76a --- /dev/null +++ b/templates/pnp4nagios/common-header.ssi.erb @@ -0,0 +1,9 @@ +<%# vim: set ts=8 sw=2 tw=0 et ft=eruby.html :%> + + +