From 41d778fe47c20f2d4c37b4c3089d50fbac6535a3 Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 18 Apr 2014 10:58:56 +0200 Subject: address puppet 3.x deprecation warnings --- templates/vhosts/partials/authentication.erb | 6 +++--- templates/vhosts/partials/header_default.erb | 22 +++++++++++----------- templates/vhosts/partials/logs.erb | 14 +++++++------- templates/vhosts/partials/mod_security.erb | 18 +++++++++--------- templates/vhosts/partials/php_settings.erb | 8 ++++---- templates/vhosts/partials/std_override_options.erb | 6 +++--- 6 files changed, 37 insertions(+), 37 deletions(-) (limited to 'templates/vhosts/partials') diff --git a/templates/vhosts/partials/authentication.erb b/templates/vhosts/partials/authentication.erb index bf43a58..ed83221 100644 --- a/templates/vhosts/partials/authentication.erb +++ b/templates/vhosts/partials/authentication.erb @@ -1,6 +1,6 @@ -<% unless htpasswd_file.to_s == 'absent' -%> +<% unless @htpasswd_file.to_s == 'absent' -%> AuthType Basic - AuthName "Access fuer <%= servername %>" - AuthUserFile <%= real_htpasswd_path %> + AuthName "Access fuer <%= @servername %>" + AuthUserFile <%= @real_htpasswd_path %> require valid-user <% end -%> diff --git a/templates/vhosts/partials/header_default.erb b/templates/vhosts/partials/header_default.erb index 398b0ce..dbba367 100644 --- a/templates/vhosts/partials/header_default.erb +++ b/templates/vhosts/partials/header_default.erb @@ -2,19 +2,19 @@ <% if vhost_part == :ssl -%> Include include.d/ssl_defaults.inc <% end -%> - ServerName <%= servername %> -<% unless serveralias.empty? || (serveralias == 'absent') -%> - ServerAlias <%= Array(serveralias).join(' ') %> + ServerName <%= @servername %> +<% unless @serveralias.empty? || (@serveralias == 'absent') -%> + ServerAlias <%= Array(@serveralias).join(' ') %> <% end -%> -<% unless server_admin.empty? || (server_admin == 'absent') -%> - ServerAdmin <%= server_admin %> +<% unless @server_admin.empty? || (@server_admin == 'absent') -%> + ServerAdmin <%= @server_admin %> <% end -%> -<% unless documentroot == 'really_absent' -%> - DocumentRoot <%= documentroot %>/ +<% unless @documentroot == 'really_absent' -%> + DocumentRoot <%= @documentroot %>/ <% end -%> -<% if default_charset != 'absent' -%> - AddDefaultCharset <%= default_charset %> +<% if @default_charset != 'absent' -%> + AddDefaultCharset <%= @default_charset %> <% end -%> -<% if passing_extension != 'absent' -%> - DirectoryIndex index.htm index.html index.<%= passing_extension %> +<% if @passing_extension != 'absent' -%> + DirectoryIndex index.htm index.html index.<%= @passing_extension %> <% end -%> diff --git a/templates/vhosts/partials/logs.erb b/templates/vhosts/partials/logs.erb index 98c834d..136508f 100644 --- a/templates/vhosts/partials/logs.erb +++ b/templates/vhosts/partials/logs.erb @@ -1,18 +1,18 @@ -<% case logmode.to_s +<% case @logmode.to_s when 'nologs' -%> ErrorLog /dev/null CustomLog /dev/null <% when 'noaccess' -%> - ErrorLog <%= logdir %>/<%= logprefix %>error_log + ErrorLog <%= @logdir %>/<%= @logprefix %>error_log CustomLog /dev/null noip <% when 'semianonym' -%> - ErrorLog <%= logdir %>/<%= logprefix %>error_log - CustomLog <%= logdir %>/<%= logprefix %>access_log noip + ErrorLog <%= @logdir %>/<%= @logprefix %>error_log + CustomLog <%= @logdir %>/<%= @logprefix %>access_log noip <% when 'anonym' -%> ErrorLog /dev/null - CustomLog <%= logdir %>/<%= logprefix %>access_log noip + CustomLog <%= @logdir %>/<%= @logprefix %>access_log noip <% else -%> - ErrorLog <%= logdir %>/<%= logprefix %>error_log - CustomLog <%= logdir %>/<%= logprefix %>access_log combined + ErrorLog <%= @logdir %>/<%= @logprefix %>error_log + CustomLog <%= @logdir %>/<%= @logprefix %>access_log combined <% end -%> diff --git a/templates/vhosts/partials/mod_security.erb b/templates/vhosts/partials/mod_security.erb index f0602d8..380e78f 100644 --- a/templates/vhosts/partials/mod_security.erb +++ b/templates/vhosts/partials/mod_security.erb @@ -1,7 +1,7 @@ -<% if mod_security.to_s == 'true' -%> +<% if @mod_security.to_s == 'true' -%> SecRuleEngine On -<% if mod_security_relevantonly.to_s == 'true' -%> +<% if @mod_security_relevantonly.to_s == 'true' -%> SecAuditEngine RelevantOnly <% else -%> SecAuditEngine On @@ -11,17 +11,17 @@ SecAuditEngine Off <% end -%> SecAuditLogType Concurrent - SecAuditLogStorageDir <%= logdir %>/ - SecAuditLog <%= logdir %>/mod_security_audit.log - SecDebugLog <%= logdir %>/mod_security_debug.log -<% unless mod_security_rules_to_disable.to_a.empty? -%> + SecAuditLogStorageDir <%= @logdir %>/ + SecAuditLog <%= @logdir %>/mod_security_audit.log + SecDebugLog <%= @logdir %>/mod_security_debug.log +<% unless (disabled_rules=Array(@mod_security_rules_to_disable)).empty? -%> -<% mod_security_rules_to_disable.to_a.each do |rule| -%> +<% disabled_rules.each do |rule| -%> SecRuleRemoveById "<%= rule %>" <% end -%> <% end -%> -<% unless mod_security_additional_options.to_s == 'absent' -%> +<% unless (s=@mod_security_additional_options).to_s == 'absent' -%> - <%= mod_security_additional_options %> + <%= s %> <% end -%> diff --git a/templates/vhosts/partials/php_settings.erb b/templates/vhosts/partials/php_settings.erb index fe55967..74f6ecf 100644 --- a/templates/vhosts/partials/php_settings.erb +++ b/templates/vhosts/partials/php_settings.erb @@ -1,6 +1,6 @@ -<% if run_mode != 'fcgid' - php_settings.reject{|k,v| v == :undef }.keys.sort.each do |key| - dvalue = php_settings[key].to_s.downcase +<% if @run_mode != 'fcgid' + @php_settings.reject{|k,v| (v == :undef) || v.nil? }.keys.sort.each do |key| + dvalue = @php_settings[key].to_s.downcase munged_value = if dvalue == 'true' 'on' elsif dvalue == 'false' @@ -8,7 +8,7 @@ elsif ['on','off'].include?(dvalue) dvalue else - php_settings[key] + @php_settings[key] end if ['on','off' ].include?(munged_value) -%> diff --git a/templates/vhosts/partials/std_override_options.erb b/templates/vhosts/partials/std_override_options.erb index f35354d..6d8b74f 100644 --- a/templates/vhosts/partials/std_override_options.erb +++ b/templates/vhosts/partials/std_override_options.erb @@ -1,4 +1,4 @@ - AllowOverride <%= allow_override %> -<% if options.to_s != 'absent' || do_includes.to_s == 'true' || run_mode == 'fcgid' -%> - Options <%- unless options.to_s == 'absent' then -%><%= options %><% end -%><% if do_includes.to_s == 'true' && !options.include?('+Includes') -%> +Includes<% end -%><% if run_mode == 'fcgid' && !options.include?('+ExecCGI') -%> +ExecCGI<% end -%> + AllowOverride <%= @allow_override %> +<% if @options.to_s != 'absent' || @do_includes.to_s == 'true' || @run_mode == 'fcgid' -%> + Options <%- unless @options.to_s == 'absent' -%><%= @options %><% end -%><% if @do_includes.to_s == 'true' && !@options.include?('+Includes') -%> +Includes<% end -%><% if @run_mode == 'fcgid' && !@options.include?('+ExecCGI') -%> +ExecCGI<% end -%> <% end -%> -- cgit v1.2.3