Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
45 changes: 24 additions & 21 deletions manifests/init.pp
Original file line number Diff line number Diff line change
@@ -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,
}

Expand Down Expand Up @@ -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 %",
}

Expand Down
10 changes: 0 additions & 10 deletions templates/squid.conf.documented
Original file line number Diff line number Diff line change
Expand Up @@ -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
# -----------------------------------------------------------------------------
Expand Down
10 changes: 0 additions & 10 deletions templates/squid.conf.long.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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
# -----------------------------------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion templates/squid.conf.short.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
Expand Down