Skip to content

Commit

Permalink
Remove support for Debian 8 / Ubuntu 14.04 (#145)
Browse files Browse the repository at this point in the history
We no longer need this logic since everything uses the same 'squid'
service now and all our debian attributes are the defaults we already
have defined here.

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored May 9, 2023
1 parent 52c1ce9 commit 9adb8ca
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .mdlrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rules "~MD013", "~MD024"
rules "~MD013", "~MD024", "~MD007"
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This file is used to list changes made in each version of the squid cookbook.

## Unreleased

- Remove support for EOL Ubuntu 14.04 and Debian 8 distributions

## 4.4.5 - *2023-02-14*

## 4.4.4 - *2022-02-08*
Expand Down
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Community Guidelines

This project follows the Chef Community Guidelines <https://docs.chef.io/community_guidelines.html>
This project follows the Chef Community Guidelines <https://docs.chef.io/community_guidelines/>
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Databags are able to be used for storing host & url acls and also which hosts/ne
- Set (`node['squid']['enable_ldap']`) to true.
- Modify the ldap attributes for your environment.

- If you use anonymous bindings, two attributes are optional, ['squid']['ldap_binddn'] and ['squid']['ldap_bindpassword'].
- If you use anonymous bindings, two attributes are optional, `['squid']['ldap_binddn']` and `['squid']['ldap_bindpassword']`.
- All other attributes are required.
- See <http://wiki.squid-cache.org/ConfigExamples/Authenticate/Ldap> for further help.

Expand Down
21 changes: 1 addition & 20 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,26 +66,7 @@
default['squid']['ldap_authrealm'] = 'Web-Proxy' # Authentication Realm
default['squid']['ldap_authcredentialsttl'] = '1 minute' # Credentials TTL

case node['platform_family']

when 'debian'
if node['platform_version'] =~ /^8|^14/
default['squid']['package'] = 'squid3'
default['squid']['config_dir'] = '/etc/squid3'
default['squid']['config_file'] = '/etc/squid3/squid.conf'
default['squid']['log_dir'] = '/var/log/squid3'
default['squid']['cache_dir'] = '/var/spool/squid3'
default['squid']['coredump_dir'] = '/var/spool/squid3'
else
default['squid']['package'] = 'squid'
default['squid']['config_dir'] = '/etc/squid'
default['squid']['config_file'] = '/etc/squid/squid.conf'
default['squid']['log_dir'] = '/var/log/squid'
default['squid']['cache_dir'] = '/var/spool/squid'
default['squid']['coredump_dir'] = '/var/spool/squid'
end

when 'freebsd'
if platform_family?('freebsd')
default['squid']['config_dir'] = '/usr/local/etc/squid'
default['squid']['config_file'] = '/usr/local/etc/squid/squid.conf'
default['squid']['cache_dir'] = '/var/squid/cache'
Expand Down
8 changes: 0 additions & 8 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ def squid_load_acls(databag_name)
acls
end

def squid_service_name
if platform_family?('debian') && node['platform_version'] =~ /^8|^14/
'squid3'
else
'squid'
end
end

def squid_version_detected
command = %(#{node['squid']['package']} -v | grep Version | sed 's/.*Version \\\(.\\..\\\).*/\\1/g' | tr -d '\n')
command_out = shell_out(command)
Expand Down
11 changes: 5 additions & 6 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# rhel_family sysconfig
template '/etc/sysconfig/squid' do
source 'redhat/sysconfig/squid.erb'
notifies :restart, "service[#{squid_service_name}]", :delayed
notifies :restart, 'service[squid]', :delayed
mode '644'
only_if { platform_family? 'rhel', 'fedora', 'amazon' }
end
Expand Down Expand Up @@ -72,15 +72,14 @@
mode '644'
end

# TODO: COOK-3041 (manage this file appropriately)
file "#{node['squid']['config_dir']}/msntauth.conf" do
action :delete
end

# squid config
template node['squid']['config_file'] do
source 'squid.conf.erb'
notifies :reload, "service[#{squid_service_name}]"
notifies :reload, 'service[squid]'
mode '644'
variables(
lazy do
Expand All @@ -104,14 +103,14 @@
command "#{node['squid']['package']} -Nz"
action :run
creates ::File.join(node['squid']['cache_dir'], '00')
notifies :stop, "service[#{squid_service_name}]", :before
notifies :start, "service[#{squid_service_name}]"
notifies :stop, 'service[squid]', :before
notifies :start, 'service[squid]'
not_if { FileTest.directory?("#{node['squid']['cache_dir']}/00") }
only_if { node['squid']['enable_cache_dir'] }
end

# services
service squid_service_name do
service 'squid' do
supports restart: true, status: true, reload: true
action [:enable, :start]
retries 5
Expand Down

0 comments on commit 9adb8ca

Please sign in to comment.