From 92ca167f3e75548b631a8aca8a2a3324b8c62fd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Casta=C3=B1eda?= Date: Thu, 12 Jan 2017 10:39:38 +0000 Subject: [PATCH 1/4] Sort params --- manifests/init.pp | 39 +++++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 3e33253..71d262f 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -1,43 +1,46 @@ # 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 ? { From f182eacc2e15bf460a57bfa89a5e0bb7957573c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Casta=C3=B1eda?= Date: Thu, 12 Jan 2017 10:44:05 +0000 Subject: [PATCH 2/4] Enable template parameter as source or content --- manifests/init.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 71d262f..5fcf0a7 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -44,8 +44,8 @@ ) 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, } @@ -80,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 %", } From 8491529b7d29dfd18fc0edb8ac21b6eeed21ed02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Casta=C3=B1eda?= Date: Thu, 12 Jan 2017 10:48:07 +0000 Subject: [PATCH 3/4] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0aa528..67b0bf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +* 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. From 521e0db0413a1b2807913dbd730143de1d031116 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Casta=C3=B1eda?= Date: Thu, 19 Jan 2017 16:00:28 +0100 Subject: [PATCH 4/4] Remove obsolete hierarchy_stoplist directive --- CHANGELOG.md | 1 + templates/squid.conf.documented | 10 ---------- templates/squid.conf.long.erb | 10 ---------- templates/squid.conf.short.erb | 1 - 4 files changed, 1 insertion(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 67b0bf6..32d4bfb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +* Remove obsolete hierarchy_stoplist directive * Enable template parameter as source or content * Sort params 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 %>