diff --git a/CHANGELOG.md b/CHANGELOG.md index b0aa528..32d4bfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +* Remove obsolete hierarchy_stoplist directive +* Enable template parameter as source or content +* Sort params + #### 2016-09-28 - 1.0.1 * Fix cache_dir in short template, must be below maximum_object_size. * Add a few parameters, make sure log ones from params can be overridden. diff --git a/manifests/init.pp b/manifests/init.pp index 3e33253..5fcf0a7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,48 +1,51 @@ # Class: squid3 # class squid3 ( + # Squid config # Options are in the same order they appear in squid.conf - $use_deprecated_opts = true, - $use_default_localnet = true, - $http_port = [ '3128' ], - $https_port = [], $acl = [], - $ssl_ports = [ '443' ], - $safe_ports = [ '80', '21', '443', '70', '210', '1025-65535', '280', '488', '591', '777', ], - $http_access = [], $icp_access = [], + $http_access = [], + $http_port = [ '3128' ], + $https_port = [], $tcp_outgoing_address = [], $cache_mem = '256 MB', + $maximum_object_size_in_memory = '512 KB', $cache_dir = [], + $maximum_object_size = '4096 KB', + $access_log = $::squid3::params::access_log, + $cache_store_log = $::squid3::params::cache_store_log, + $strip_query_terms = undef, + $cache_log = $::squid3::params::cache_log, $cache = [], + $refresh_patterns = [], $via = 'on', $reply_header_access = [], $ignore_expect_100 = 'off', $pconn_timeout = undef, $cache_mgr = 'root', - $forwarded_for = 'on', $client_persistent_connections = 'on', $server_persistent_connections = 'on', - $maximum_object_size = '4096 KB', - $maximum_object_size_in_memory = '512 KB', + $forwarded_for = 'on', + $use_deprecated_opts = true, + $use_default_localnet = true, + $ssl_ports = [ '443' ], + $safe_ports = [ '80', '21', '443', '70', '210', '1025-65535', '280', '488', '591', '777', ], $config_array = false, $config_hash = false, - $refresh_patterns = [], - $template = 'long', - $package_version = 'installed', + + # Puppet config $package_name = $::squid3::params::package_name, - $service_ensure = 'running', + $package_version = 'installed', $service_enable = $::squid3::params::service_enable, + $service_ensure = 'running', $service_name = $::squid3::params::service_name, - $access_log = $::squid3::params::access_log, - $cache_log = $::squid3::params::cache_log, - $cache_store_log = $::squid3::params::cache_store_log, - $strip_query_terms = undef, + $template = 'long', ) inherits ::squid3::params { $use_template = $template ? { - 'short' => 'squid3/squid.conf.short.erb', - 'long' => 'squid3/squid.conf.long.erb', + 'short' => template('squid3/squid.conf.short.erb'), + 'long' => template('squid3/squid.conf.long.erb'), default => $template, } @@ -77,7 +80,7 @@ file { $config_file: require => Package['squid3_package'], notify => Service['squid3_service'], - content => template($use_template), + content => $use_template, validate_cmd => "${cmdpath}/${service_name} -k parse -f %", } diff --git a/templates/squid.conf.documented b/templates/squid.conf.documented index d4c8fd2..69d1dc5 100644 --- a/templates/squid.conf.documented +++ b/templates/squid.conf.documented @@ -1863,16 +1863,6 @@ http_port 3128 #Default: # forward_max_tries 10 -# TAG: hierarchy_stoplist -# A list of words which, if found in a URL, cause the object to -# be handled directly by this cache. In other words, use this -# to not query neighbor caches for certain objects. You may -# list this option multiple times. -# Note: never_direct overrides this option. -# - -# We recommend you to use at least the following line. -hierarchy_stoplist cgi-bin ? # MEMORY CACHE OPTIONS # ----------------------------------------------------------------------------- diff --git a/templates/squid.conf.long.erb b/templates/squid.conf.long.erb index 9b5fe6a..c993a32 100644 --- a/templates/squid.conf.long.erb +++ b/templates/squid.conf.long.erb @@ -1883,16 +1883,6 @@ tcp_outgoing_address <%= line %> #Default: # forward_max_tries 10 -# TAG: hierarchy_stoplist -# A list of words which, if found in a URL, cause the object to -# be handled directly by this cache. In other words, use this -# to not query neighbor caches for certain objects. You may -# list this option multiple times. -# Note: never_direct overrides this option. -# - -# We recommend you to use at least the following line. -hierarchy_stoplist cgi-bin ? # MEMORY CACHE OPTIONS # ----------------------------------------------------------------------------- diff --git a/templates/squid.conf.short.erb b/templates/squid.conf.short.erb index d5e191e..58d35a4 100644 --- a/templates/squid.conf.short.erb +++ b/templates/squid.conf.short.erb @@ -69,7 +69,6 @@ tcp_outgoing_address <%= line %> # general settings -hierarchy_stoplist cgi-bin ? coredump_dir <%= @coredump_dir %> maximum_object_size_in_memory <%= @maximum_object_size_in_memory %> maximum_object_size <%= @maximum_object_size %>