Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options for Squid's built in SNMP support #38

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
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: 3 additions & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
class squid3 (
# Options are in the same order they appear in squid.conf
$auth_params = [],
$use_deprecated_opts = true,
$use_deprecated_opts = false,
$use_default_localnet = true,
$http_port = [ '3128' ],
$https_port = [],
$snmp_port = [],
$acl = [],
$ssl_ports = [ '443' ],
$safe_ports = [ '80', '21', '443', '70', '210', '1025-65535', '280', '488', '591', '777', ],
$http_access = [],
$snmp_access = [],
$icp_access = [],
$tcp_outgoing_address = [],
$cache_mem = '256 MB',
Expand Down
3 changes: 2 additions & 1 deletion manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
$coredump_dir = '/var/spool/squid'
}
'Debian': {
if $::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease,'16.04') >= 0 {
if ($::operatingsystem == 'Ubuntu' and versioncmp($::operatingsystemrelease,'16.04') >= 0) or
($::operatingsystem == 'Debian' and versioncmp($::operatingsystemrelease,'11') >= 0) {
$package_name = 'squid'
$service_name = 'squid'
$service_enable = false
Expand Down
7 changes: 7 additions & 0 deletions templates/squid.conf.long.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4091,6 +4091,9 @@ server_persistent_connections <%= @server_persistent_connections %>
# snmp_port 3401
#Default:
# snmp_port 0
<% @snmp_port.each do |line| -%>
snmp_port <%= line %>
<% end -%>

# TAG: snmp_access
# Allowing or denying access to the SNMP port.
Expand All @@ -4107,6 +4110,10 @@ server_persistent_connections <%= @server_persistent_connections %>
# snmp_access deny all
#Default:
# snmp_access deny all
<% @snmp_access.each do |line| -%>
snmp_access <%= line %>
<% end -%>
snmp_access deny all

# TAG: snmp_incoming_address
# TAG: snmp_outgoing_address
Expand Down
13 changes: 13 additions & 0 deletions templates/squid.conf.short.erb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ http_access allow localnet
http_access allow localhost
http_access deny all

# user-defined snmp_accesses
<% @snmp_access.each do |line| -%>
snmp_access <%= line %>
<% end -%>
snmp_access deny all

# user-defined icp_access
<% @icp_access.each do |line| -%>
icp_access <%= line %>
Expand All @@ -58,6 +64,13 @@ http_port <%= line %>
<% end -%>
<% end -%>

<% if @snmp_port -%>
# user-defined snmp_port
<% @snmp_port.each do |line| -%>
snmp_port <%= line %>
<% end -%>
<% end -%>

<% if @https_port -%>
# user-defined https_port
<% @https_port.each do |line| -%>
Expand Down