diff --git a/svn/manifests/init.pp b/svn/manifests/init.pp index 9817abd..71c43e3 100644 --- a/svn/manifests/init.pp +++ b/svn/manifests/init.pp @@ -7,7 +7,10 @@ class svn { } file { "/etc/subversion/servers": - ensure => present, + ensure => $http_proxy ? { + "" => absent, + default => present, + }, mode => "0644", owner => "root", group => "root", diff --git a/svn/templates/servers.erb b/svn/templates/servers.erb index 791a83a..1e1c1aa 100644 --- a/svn/templates/servers.erb +++ b/svn/templates/servers.erb @@ -1,11 +1,7 @@ -[global] <% -if has_variable?("http_proxy") - http_proxy_host, http_proxy_port = http_proxy.split(":") - http_proxy_port = "80" if http_proxy_port.nil? +http_proxy_host, http_proxy_port = http_proxy.split(":") +http_proxy_port = "80" if http_proxy_port.nil? -%> -<% end -%> -<% if http_proxy_host and http_proxy_port -%> +[global] http-proxy-host = <%= http_proxy_host %> http-proxy-port = <%= http_proxy_port %> -<% end -%>