From b3c66a890f31249efdd969583f297276de1f4d7d Mon Sep 17 00:00:00 2001 From: Vadym Chepkov Date: Mon, 2 Nov 2015 18:06:04 -0500 Subject: [PATCH] make optional auth block of httpd-nagios.conf apache_httpd_htpasswd_source is optional in server.pp, this change makes block depending on it optional as well --- templates/apache_httpd/httpd-nagios.conf.erb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/apache_httpd/httpd-nagios.conf.erb b/templates/apache_httpd/httpd-nagios.conf.erb index 75a08f2e..2487dee0 100644 --- a/templates/apache_httpd/httpd-nagios.conf.erb +++ b/templates/apache_httpd/httpd-nagios.conf.erb @@ -9,10 +9,12 @@ ScriptAlias /nagios/cgi-bin/ /usr/<%= scope.lookupvar("nagios::params::libdir") Allow from <%= val %> <% end -%> <% end -%> +<%if @apache_httpd_htpasswd_source -%> AuthType Basic AuthUserFile /etc/nagios/.htpasswd AuthName "Nagios" Require valid-user +<% end -%> Alias /nagios/ /usr/share/nagios/html/ @@ -26,10 +28,12 @@ Alias /nagios/ /usr/share/nagios/html/ Allow from <%= val %> <% end -%> <% end -%> +<%if @apache_httpd_htpasswd_source -%> AuthType Basic AuthUserFile /etc/nagios/.htpasswd AuthName "Nagios" Require valid-user +<% end -%> # For SSL-servers @@ -57,4 +61,3 @@ Alias /nagios/ /usr/share/nagios/html/ # AuthName "nagios" # Require valid-user # -