Giter Site home page Giter Site logo

sous-chefs / squid Goto Github PK

View Code? Open in Web Editor NEW
28.0 52.0 79.0 616 KB

Development repository for the squid cookbook

Home Page: https://supermarket.chef.io/cookbooks/squid

License: Apache License 2.0

Ruby 78.88% HTML 21.12%
chef-cookbook squid chef-resource chef hacktoberfest managed-by-terraform

squid's Introduction

squid Cookbook

Cookbook Version Build Status OpenCollective OpenCollective License

Installs and configures Squid as a caching proxy.

Maintainers

This cookbook is maintained by the Sous Chefs. The Sous Chefs are a community of Chef cookbook maintainers working together to maintain important cookbooks. If youโ€™d like to know more please visit sous-chefs.org or come chat with us on the Chef Community Slack in #sous-chefs.

Requirements

Platforms

  • Debian 10+
  • Ubuntu 16.04+
  • RHEL/CentOS/Scientific 7+
  • openSUSE / openSUSE Leap
  • FreeBSD 11+

Chef

  • Chef 13+

Cookbooks

  • none

Recipes

default

The default recipe installs squid and sets up simple proxy caching. As of now, the options you may change are the port (node['squid']['port']) and the network the caching proxy is available on the subnet from node.ipaddress (ie. "192.168.1.0/24") but may be overridden with node['squid']['network']. The size of objects allowed to be stored has been bumped up to allow for caching of installation files. An optional (node['squid']['cache_peer']), if set, will be written verbatim to the template. On redhat based platforms, this cookbook supports customizing the max number of file descriptors that Squid may open (node['squid']['max_file_descriptors']). The default value is 1024.

Usage

Include the squid recipe on the server. Other nodes may search for this node as their caching proxy and use the node.ipaddress and node['squid']['port'] to point at it.

Databags are able to be used for storing host & url acls and also which hosts/nets are able to access which hosts/url

LDAP Authentication

  • Set (node['squid']['enable_ldap']) to true.

  • Modify the ldap attributes for your environment.

  • To create the ldap acls in squid.conf, you also need the two ldap_auth databag items as shown in the LDAP Databags below.

Example Databags

squid_urls - yubikey item

{
  "urls": [
    "^https://api.yubico.com/wsapi/2.0/verify"
  ],
  "id": "yubikey"
}

squid_hosts - bastion item

{
  "type": "src",
  "id": "bastion",
  "net": [
    "192.168.0.2/32"
  ]
}

squid_acls - bastion item

{
  "id": "bastion",
  "acl": [
    [
      "yubikey",
      "allow"
    ],
    [
      "yubikey",
      "deny",
      "!"
    ],
    [
      "all",
      "deny"
    ]
  ]
}

LDAP Databags

The following two data bags are only required if you are using LDAP Authentication.

squid_hosts - ldap_auth item

{
  "type": "proxy_auth",
  "id": "ldap_auth",
  "net": [
    "REQUIRED"
  ]
}

squid_acls - ldap_auth item

{
  "id": "ldap_auth",
  "acl": [
    [
      "",
      "allow"
    ]
  ]
}

Additional configuration files

  • Set (node['squid']['config_include_dir']) to the directory of your additional files, ex. /etc/squid/conf.d
  • It is recommended that you set node['squid']['http_access_deny_all'] and node['squid']['icp_access_deny_all'] to false because the include statement is at the bottom of squid.conf. Otherwise http_access allow statements may not be evaluated in the additional configuration files.

Contributors

This project exists thanks to all the people who contribute.

Backers

Thank you to all our backers!

https://opencollective.com/sous-chefs#backers

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website.

https://opencollective.com/sous-chefs/sponsor/0/website https://opencollective.com/sous-chefs/sponsor/1/website https://opencollective.com/sous-chefs/sponsor/2/website https://opencollective.com/sous-chefs/sponsor/3/website https://opencollective.com/sous-chefs/sponsor/4/website https://opencollective.com/sous-chefs/sponsor/5/website https://opencollective.com/sous-chefs/sponsor/6/website https://opencollective.com/sous-chefs/sponsor/7/website https://opencollective.com/sous-chefs/sponsor/8/website https://opencollective.com/sous-chefs/sponsor/9/website

squid's People

Contributors

agarat avatar akadoya avatar axelrtgs avatar brugidou avatar damacus avatar dansweeting avatar deevidh avatar eheydrick avatar jpmat296 avatar juliandunn avatar kitchen-porter avatar mattmencel avatar mattray avatar mkristan avatar powerschill avatar ramereth avatar renovate[bot] avatar samdunne avatar sethvargo avatar snkutlu avatar stefanwb avatar stevendanna avatar stromp avatar tas50 avatar thomsh avatar thoutenbos avatar wbcchsyn avatar welbymcroberts avatar xorima avatar xorimabot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

squid's Issues

Please remove unneeded logs

I have such error:

22: # variables
23: ipaddress = node['ipaddress']
24: listen_interface = node['squid']['listen_interface']
25: version = node['squid']['version']
26>> netmask = node['network']['interfaces'][listen_interface]['addresses'][ipaddress]['netmask']
27:
28: # squid/libraries/default.rb
29: acls = squid_load_acls
30: host_acl = squid_load_host_acl
31: url_acl = squid_load_url_acl
32:
33: # Log variables to Chef::Log::debug()
34: Chef::Log.debug("Squid listen_interface: #{listen_interface}")
35: Chef::Log.debug("Squid ipaddress: #{ipaddress}")

This is on squid in LVS configuration, have three interfaces: eth0, lo and lo:0

I found that in attributes you have (I suppose this have to remove lo device but this didn't work on my machine):

default['squid']['listen_interface'] = node['network']['interfaces'].dup.reject { |k, v| k == 'lo' }.keys.first

Then in recipe:

listen_interface = node['squid']['listen_interface']
netmask = node['network']['interfaces'][listen_interface]['addresses'][ipaddress]['netmask']

Chef::Log.debug("Squid listen_interface: #{listen_interface}")
Chef::Log.debug("Squid netmask: #{netmask}")

And this Log.debug invocations are the only place where this variables are used :-)
Please remove or fix this.

Converge after first generates borked squid.conf

Cookbook version

3.0.0

Chef-client version

12.6.0

Platform Details

Ubuntu 14.04

Scenario:

Second run bork squid.conf

Steps to Reproduce:

Converge a first time, squid works. Converge a second time, squid restart fail.

Expected Result:

No changes to any resources during the second run.

Actual Result:

 * template[/etc/squid3/squid.conf] action create
   - update content in file /etc/squid3/squid.conf from a1b447 to db7f67
   --- /etc/squid3/squid.conf  2017-04-13 14:03:50.932337709 +0000
   +++ /etc/squid3/.squid.conf20170413-19199-1i8py4t   2017-04-13 14:04:42.193865351 +0000
   @@ -3,10 +3,10 @@
    
    
    
   -
   -
   -
   -
   +acl all src
   +acl manager proto cache_object
   +acl localhost src 127.0.0.1/32
   +acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
    acl localnet src 10.0.0.0/8
    acl localnet src 172.16.0.0/12
    acl localnet src 192.168.0.0/16

cache.log

FATAL: Bungled /etc/squid3/squid.conf line 7: acl manager proto cache_object
Squid Cache (Version 3.3.8): Terminated abnormally.

I bet this bug got introduced in 17f843e, revert it?

Idempotency fail

๐Ÿ‘ป Brief Description

The ruby_block[Detect squid version] resource updates on every chef converge breaking our idempotency test.

๐Ÿฅž Cookbook version

4.1.0

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

Chef Workstation version: 0.9.42
Chef Infra Client version: 15.3.14
Chef InSpec version: 4.16.0
Chef CLI version: 1.0.16
Test Kitchen version: 2.3.3
Cookstyle version: 5.6.2

๐ŸŽฉ Platform details

Tested on centos 7.

Steps To Reproduce

  1. Add the following to the kitchen.yml file (this does not work on kitchen dokken).
provisioner:
  name: chef_zero
  deprecations_as_errors: true
  multiple_converge: 2
  enforce_idempotency: true
  1. run kitchen test

Error Message:

       First chef run should have reached a converged state.
       Resources updated in a second chef-client run:
       - ruby_block[Detect squid version]

๐Ÿš“ Expected behavior

The second time the system is converged no resources should be updated.

โž• Additional context

The following block of code updates on every converge.

ruby_block 'Detect squid version' do
  block do
    Chef::Resource::RubyBlock.send(:include, Chef::Mixin::ShellOut)
    command = %(#{node['squid']['package']} -v | grep Version | sed 's/.*Version \\\(.\\..\\\).*/\\1/g' | tr -d '\n')
    command_out = shell_out(command)
    node.normal['squid']['squid_version_detected'] = command_out.stdout.to_f
  end
end

Remove .rubocop.yml with Dangerfile

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

If the only thing in the .rubocop/yml is Dangerfile
Run the latest cookstyle
Remove .rubpopo.yml

Issue sprouted from sous-chefs/meta/issues/108. If not applicable then issue should be closed.

Removal of Unregistered ports as safe ports

Although i understand it is in the interests of the deployer to change this config, however in my opinion it seems a bit dangerous to create a proxy that deems all unregistered ports as "Safe ports".

acl Safe_ports port 1025-65535 # unregistered ports

Debian support is broken

The attributes for Debian only include 6.0.3. This needs to be replaced with support for 7.X and 8.X

Update builds to be parallel

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

As part of our build process we should build each possible operating system separately

  1. Ensure you have dokken setup and working:
  2. dokken: aliased to KITCHEN_LOCAL_YAML=kitchen.dokken.yml kitchen
  3. run dokken list, you should see a list of builds with dokken as the provider
  4. download: https://github.com/sous-chefs/repo-management/blob/master/scripts/circleci_maker.rb and make this executable
  5. run: dokken list -j | ./circleci_maker.rb > .circleci/config.yml

Issue sprouted from sous-chefs/meta/issues/112. If not applicable then issue should be closed.

squid_acls ID "not" operator broken

I haven't seen a lot of activity in this GitHub repo, nor a lot of replies to bug filings. I wouldn't be surprised if this goes unnoticed for many months, but here goes anyway.

Cookbook version

v1.1.1 (v2.0.0 is not an option as it is currently broken with Ubuntu 14.04)

Chef-client version

Chef Development Kit Version: 0.17.17
chef-client version: 12.13.37
delivery version: master (f68e5c5804cd7d8a76c69b926fbb261e1070751b)
berks version: 4.3.5
kitchen version: 1.11.1

Platform Details

Ubuntu 14.04

Scenario:

Deny all destination domains that is not accessing S3, SQS, SNS (region us-east-1).

Steps to Reproduce:

Create a databag item squid_host/aws.json with the following contents:

{
    "id": "aws",
    "type": "dstdomain",
    "net": [
        ".sns.us-east-1.amazonaws.com",
        ".sqs.us-east-1.amazonaws.com",
        ".s3.amazonaws.com"
    ]
}

Create another data bag item squid_acl/aws.json with the following contents:

{
    "id": "!aws",
    "acl": [
        [
            "",
            "allow"
        ]
    ]
}

Expected Result:

/var/squid3/squid.conf should be updated with the following lines:

acl aws dstdomain .sns.us-east-1.amazonaws.com
acl aws dstdomain .sqs.us-east-1.amazonaws.com
acl aws dstdomain .s3.amazonaws.com
http_access deny !aws

Actual Result:

Only the acl lines are added. The "http_access deny !aws" line is not present. Chef prints: ERROR: Failed to load data bag item: "squid_acls" "!aws"

It seems the "id" attribute is reserved for chef. And their schema will not allow users to configure Squid to it's fullest. I recommend updating the squid cookbook to not use the "id" attribute.

Can 3.1.0 be pushed up to supermarket? Its currently in master.

Cookbook version

3.1.0

Chef-client version

12.6.0

Platform Details

Ubuntu 14.04

Scenario:

I would like to use the config_include_dir feature in 3.1.0.

Steps to Reproduce:

3.0.0 current version doesn't have the changes that are in master.

Expected Result:

         * directory[squid_config_include_dir] action create
           - create new directory /etc/squid3/conf.d
           - change mode from '' to '0755'
           - change owner from '' to 'root'
         * file[squid_config_include_dir_dummy.conf] action create
           - create new file /etc/squid3/conf.d/dummy.conf
           - update content in file /etc/squid3/conf.d/dummy.conf from none to daad71
           --- /etc/squid3/conf.d/dummy.conf	2017-05-19 20:09:36.082909012 +0000
           +++ /etc/squid3/conf.d/.squid_config_include_dir_dummy.conf20170519-5376-y780yy	2017-05-19 20:09:36.082909012 +0000
           @@ -1 +1,2 @@
           +# Dummy conf to enable Squid includes in conf.d
         * cookbook_file[/etc/squid3/mime.conf] action create (up to date)
         * file[/etc/squid3/msntauth.conf] action delete (up to date)
         * template[/etc/squid3/squid.conf] action create
           - update content in file /etc/squid3/squid.conf from 4b64fd to e5d5a3
           --- /etc/squid3/squid.conf	2017-05-19 19:51:08.702863457 +0000
           +++ /etc/squid3/.squid.conf20170519-5376-1o1fvog	2017-05-19 20:09:36.102909012 +0000
           @@ -72,4 +72,7 @@
            cache_dir ufs /var/spool/squid3 100 16 256
            coredump_dir /var/spool/squid3
            cache_mem 2048 MB
           +
           +# Include additional configuration files
           +include /etc/squid3/conf.d/*.conf

Actual Result:

3.0.0 Doesn't have the changes in master branch.

Ubuntu 14.04 Broken

Cookbook version

2.0.0

Chef-client version

12.14.77

Platform Details

Ubuntu 14.04

Scenario:

Run default recipe

Steps to Reproduce:

Run default recipe on Ubuntu 14.04

Expected Result:

Recipe completes without error

Actual Result:

` * template[/etc/squid3/squid.conf] action create (up to date)

  • execute[initialize squid cache dir] action run

    Error executing action run on resource 'execute[initialize squid cache dir]'

    Mixlib::ShellOut::ShellCommandFailed

    Expected process to exit with [0], but received '1'
    ---- Begin output of squid3 -Nz ----
    STDOUT:
    STDERR: 2016/09/20 15:21:23| aclParseAclLine: ACL 'manager' already exists with different type.
    FATAL: Bungled /etc/squid3/squid.conf line 7: acl manager proto cache_object
    Squid Cache (Version 3.3.8): Terminated abnormally.
    CPU Usage: 0.004 seconds = 0.004 user + 0.000 sys
    Maximum Resident Size: 373328 KB
    Page faults with physical i/o: 0
    ---- End output of squid3 -Nz ----
    Ran squid3 -Nz returned 1

    Cookbook Trace:

    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:41:in `run_action'

    Resource Declaration:

    In /var/chef/cache/cookbooks/squid/recipes/default.rb

    93: execute 'initialize squid cache dir' do
    94: command "#{node['squid']['package']} -Nz"
    95: action :run
    96: creates ::File.join(node['squid']['cache_dir'], '00')
    97: end
    98:

    Compiled Resource:

    Declared in /var/chef/cache/cookbooks/squid/recipes/default.rb:93:in `from_file'

    execute("initialize squid cache dir") do
    action [:run]
    retries 0
    retry_delay 2
    default_guard_interpreter :execute
    command "squid3 -Nz"
    backup 5
    creates "/var/spool/squid3/00"
    returns 0
    declared_type :execute
    cookbook_name "squid"
    recipe_name "default"
    end

    Platform:

    x86_64-linux

`

This is the commit that broke it:
b1bf42c

Ubuntu 14.04 uses squid 3.3 not 3.1

Run latest cookstyle

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Chef have released updated cookstyle rules, we should therefore run the auto fix against the cookbook

  1. Ensure you are on the latest stable chef-workstation
  2. Run cookstyle -a

Issue sprouted from sous-chefs/meta/issues/111. If not applicable then issue should be closed.

Add support for Ubuntu 14.04

Maybe we can add support for Ubuntu 14.04, currently breaks:

# recipes/default.rb
include_recipe 'squid'

Solo run:

==> default: [2014-08-04T15:56:35+00:00] INFO: *** Chef 11.14.2 ***
==> default: [2014-08-04T15:56:35+00:00] INFO: Chef-client pid: 1513
==> default: [2014-08-04T15:56:41+00:00] INFO: Setting the run_list to ["recipe[test-squid::default]"] from CLI options
==> default: [2014-08-04T15:56:41+00:00] INFO: Run List is [recipe[test-squid::default]]
==> default: [2014-08-04T15:56:41+00:00] INFO: Run List expands to [test-squid::default]
==> default: [2014-08-04T15:56:41+00:00] INFO: Starting Chef Run for test-squid-berkshelf
==> default: [2014-08-04T15:56:41+00:00] INFO: Running start handlers
==> default: [2014-08-04T15:56:41+00:00] INFO: Start handlers complete.
==> default: [2014-08-04T15:56:41+00:00] ERROR: Failed to list data bag items in data bag: "squid_acls"
==> default: [2014-08-04T15:56:41+00:00] INFO: no 'squid_acls' data bag
==> default: [2014-08-04T15:56:41+00:00] ERROR: Failed to list data bag items in data bag: "squid_hosts"
==> default: [2014-08-04T15:56:41+00:00] INFO: no 'squid_hosts' data bag
==> default: [2014-08-04T15:56:41+00:00] ERROR: Failed to list data bag items in data bag: "squid_urls"
==> default: [2014-08-04T15:56:41+00:00] INFO: no 'squid_urls' data bag
==> default: [2014-08-04T15:56:52+00:00] INFO: directory[/etc/squid] created directory /etc/squid
==> default: [2014-08-04T15:56:52+00:00] INFO: directory[/etc/squid] owner changed to 0
==> default: [2014-08-04T15:56:52+00:00] INFO: directory[/etc/squid] mode changed to 755
==> default: [2014-08-04T15:56:52+00:00] INFO: cookbook_file[/etc/squid/mime.conf] created file /etc/squid/mime.conf
==> default: [2014-08-04T15:56:52+00:00] INFO: cookbook_file[/etc/squid/mime.conf] updated file contents /etc/squid/mime.conf
==> default: [2014-08-04T15:56:52+00:00] INFO: cookbook_file[/etc/squid/mime.conf] mode changed to 644
==> default: [2014-08-04T15:56:52+00:00] INFO: template[/etc/squid/squid.conf] created file /etc/squid/squid.conf
==> default: [2014-08-04T15:56:52+00:00] INFO: template[/etc/squid/squid.conf] updated file contents /etc/squid/squid.conf
==> default: [2014-08-04T15:56:52+00:00] INFO: template[/etc/squid/squid.conf] mode changed to 644
==> default: 
==> default: ================================================================================
==> default: Error executing action `enable` on resource 'service[squid]'
==> default: ================================================================================
==> default: 
==> default: 
==> default: ArgumentError
==> default: -------------
==> default: File '/etc/init/squid.conf' does not exist
==> default: 
==> default: 
==> default: Resource Declaration:
==> default: ---------------------
==> default: # In /tmp/vagrant-chef-3/chef-solo-1/cookbooks/squid/recipes/default.rb
==> default: 
==> default: 
==> default: 
==> default:  86: service node['squid']['service_name'] do
==> default: 
==> default:  87:   supports :restart => true, :status => true, :reload => true
==> default: 
==> default:  88:   provider Chef::Provider::Service::Upstart if platform?('ubuntu')
==> default: 
==> default:  89:   action [:enable, :start]
==> default: 
==> default:  90: end
==> default: 
==> default: 
==> default: Compiled Resource:
==> default: ------------------
==> default: # Declared in /tmp/vagrant-chef-3/chef-solo-1/cookbooks/squid/recipes/default.rb:86:in `from_file'
==> default: 
==> default: service("squid") do
==> default:   provider Chef::Provider::Service::Upstart
==> default:   action [:enable, :start]
==> default:   supports {:restart=>true, :status=>true, :reload=>true}
==> default:   retries 0
==> default:   retry_delay 2
==> default:   guard_interpreter :default
==> default:   service_name "squid"
==> default:   pattern "squid"
==> default:   cookbook_name :squid
==> default:   recipe_name "default"
==> default: end
==> default: 
==> default: [2014-08-04T15:56:52+00:00] INFO: Running queued delayed notifications before re-raising exception
==> default: [2014-08-04T15:56:52+00:00] INFO: template[/etc/squid/squid.conf] sending reload action to service[squid] (delayed)
==> default: [2014-08-04T15:56:52+00:00] ERROR: Running exception handlers
==> default: [2014-08-04T15:56:52+00:00] ERROR: Exception handlers complete
==> default: [2014-08-04T15:56:52+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
==> default: [2014-08-04T15:56:52+00:00] ERROR: service[squid] (squid::default line 86) had an error: ArgumentError: File '/etc/init/squid.conf' does not exist
==> default: [2014-08-04T15:56:52+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

squid complain about localhost with squid > 3.2

Using squid (3.3.8) on Ubuntu 14.04, it complains during logrotate:

2014/12/01 12:54:39| WARNING: (B) '127.0.0.1' is a subnetwork of (A) '127.0.0.1'
2014/12/01 12:54:39| WARNING: because of this '127.0.0.1' is ignored to keep splay tree searching predictable
2014/12/01 12:54:39| WARNING: You should probably remove '127.0.0.1' from the ACL named 'localhost'
2014/12/01 12:54:39| WARNING: (B) '127.0.0.1' is a subnetwork of (A) '127.0.0.1'
2014/12/01 12:54:39| WARNING: because of this '127.0.0.1' is ignored to keep splay tree searching   predictable
2014/12/01 12:54:39| WARNING: You should probably remove '127.0.0.1' from the ACL named 'localhost'

It seems that acl localhost src 127.0.0.1/32 shouldn't defined anymore (see http://www.squid-cache.org/mail-archive/squid-users/201109/0342.html)

Thought ?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • sous-chefs/.github 3.1.1
  • actions/checkout v4
  • actionshub/chef-install 3.0.0
  • actionshub/test-kitchen 3.0.0
.github/workflows/stale.yml
  • actions/stale v9

  • Check this box to trigger a request for Renovate to run again on this repository

Fails while fetching IP and netmask

Cookbook version

4.0.2

Chef-client version

chef-12.21.3-1.el6.x86_64

Platform Details

CentOS release 6.9 (Final)
CloudPlatform : Azure

Scenario:

Recipe intermittently fails while fetching the netmask
https://github.com/chef-cookbooks/squid/blob/master/recipes/default.rb#L23

Steps to Reproduce:

We have included the default recipe in one of our cookbook ( basically which setup NAT ) and running chef-client from bootstrap script ( which executes when server comes up for the very first time).

Expected Result:

Squid recipe will fail.

Actual Result:

Don't have it handy right now. Will update once re-create the server.

Chef run fails on Debian-like systems

Environment: Squid cookbook 1.1.0, Ubuntu 14.04.3 LTS

Scenario: Running the cookbook fails

Steps to Reproduce: Run the cookbook

Expected Result: Squid is installed and starts

Actual Result: Chef gets an error when trying to run squid -Nz because the Debian squid package names the binary squid3.

Ubuntu installs `squid3` package and configuration in `squid` directories

Cookbook version

3.0.0

Platform Details

Ubuntu 16.04, AWS

When installing Squid using this chef cookbook on Ubuntu 16.04, the recipe installs config to the wrong location. This cookbook assumes the name of the package, and paths to all relavent directories, is "squid3". For this version of Ubuntu, squid3 appears to be a valid package, as is squid, but the service is installed as squid and config and log directories are squid.

I've worked around this by overriding all of the relevant node attributes to point the right directories.

e.g.

node.override['squid']['package'] = 'squid'
node.override['squid']['config_dir'] = '/etc/squid'
node.override['squid']['config_file'] = '/etc/squid/squid.conf'
node.override['squid']['service_name'] = 'squid'
node.override['squid']['log_dir'] = '/var/log/squid'
node.override['squid']['cache_dir'] = '/var/spool/squid'
node.override['squid']['coredump_dir'] = '/var/spool/squid'

squid stops every run if cache dir isn't enabled

๐Ÿ‘ป Brief Description

Stopping squid to create cache dirs was added #135 and all is well if you have caching enabled. However if you don't have caching enabled (e.g. node['squid']['enable_cache_dir'] = false) then squid will stop and then start on every run.

๐Ÿฅž Cookbook version

The problem was introduced in 4.4.0

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

17.2

๐ŸŽฉ Platform details

Debian 10

Steps To Reproduce

Steps to reproduce the behavior:

Set node['squid']['enable_cache_dir'] = falseand include squid::default.

๐Ÿš“ Expected behavior

squid should not stop and start every run

โž• Additional context

#135

FATAL: Bungled squid.conf line 59: cache_dir ufs /var/spool/squid 16 256

I saw this error when I install squid in Centos OS.

2014/06/10 06:03:56| Processing Configuration File: /etc/squid/squid.conf (depth 0)
FATAL: Bungled squid.conf line 59: cache_dir ufs /var/spool/squid 16 256

Squid Cache (Version 3.1.10): Terminated abnormally.

I just fix that by changing this.

cache_dir ufs <%= node['squid']['cache_dir'] %> <%= node['squid']['cache_size'] %> 16 256
cache_dir ufs <%= node['squid']['cache_dir'] %> <%= node['squid']['cache_size'] %> 100 16 256

should I check this in?

Update Changelog

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Update all CHANGELOGs to follow standard defined at https://keepachangelog.com/

Issue sprouted from sous-chefs/meta/issues/101. If not applicable then issue should be closed.

Add include for additional .conf files inside squid.conf.erb template

Cookbook version

1.1.1

Chef-client version

12.5.1

Platform Details

CentOS

Scenario:

I would like to write a wrapper cookbook that adds additional squid configurations but do so in a way that doesn't require overwriting the squid cookbook's squid.conf.erb template. I'd rather create a conf.d directory and put additional configurations in that directory. An existing pull request from 2015 appears to solve that problem.

Steps to Reproduce:

I'm using the fork of the chef-cookbooks/squid and merged in the changes from pull request 42 into master on my local repository.

Expected Result:

The updated squid.conf.erb template contains an 'include' statement allowing me to add additional rules in those directories.

Allowing private ip addresses to use the squid proxy

Cookbook version

2.0

Chef-client version

12.4.1

Platform Details

CentOS 6.7 x86_64

The Problem

I only want to allow RFC1918 ip addresses to use the squid proxy.

As squid.conf.erb already has private ip addresses assigned to the localnet ACL, it seems that node['squid']['localnets'] should be left empty. But, if it is left empty, a rule is never created to allow localnet to use the proxy. On the other hand, if node['squid']['localnets'] is left as-is, squid is not very happy.

2016/11/15 09:01:30| WARNING: (B) '10.0.0.0/8' is a subnetwork of (A) '10.0.0.0/8'
2016/11/15 09:01:30| WARNING: because of this '10.0.0.0/8' is ignored to keep splay tree searching predictable
2016/11/15 09:01:30| WARNING: You should probably remove '10.0.0.0/8' from the ACL named 'localnet'
2016/11/15 09:01:30| WARNING: (B) '172.16.0.0/12' is a subnetwork of (A) '172.16.0.0/12'
2016/11/15 09:01:30| WARNING: because of this '172.16.0.0/12' is ignored to keep splay tree searching predictable
2016/11/15 09:01:30| WARNING: You should probably remove '172.16.0.0/12' from the ACL named 'localnet'
2016/11/15 09:01:30| WARNING: (B) '172.16.0.0/12' is a subnetwork of (A) '172.16.0.0/12'
2016/11/15 09:01:30| WARNING: because of this '172.16.0.0/12' is ignored to keep splay tree searching predictable
2016/11/15 09:01:30| WARNING: You should probably remove '172.16.0.0/12' from the ACL named 'localnet'
2016/11/15 09:01:30| WARNING: (B) '192.168.0.0/16' is a subnetwork of (A) '192.168.0.0/16'
2016/11/15 09:01:30| WARNING: because of this '192.168.0.0/16' is ignored to keep splay tree searching predictable
2016/11/15 09:01:30| WARNING: You should probably remove '192.168.0.0/16' from the ACL named 'localnet'
2016/11/15 09:01:30| WARNING: (B) '192.168.0.0/16' is a subnetwork of (A) '192.168.0.0/16'
2016/11/15 09:01:30| WARNING: because of this '192.168.0.0/16' is ignored to keep splay tree searching predictable
2016/11/15 09:01:30| WARNING: You should probably remove '192.168.0.0/16' from the ACL named 'localnet'

Perhaps the static ACL entries should be removed.

/libraries folder is currently missing in your 'master' branch

Cookbook version

3.1.0

Chef-client version

12.9

Platform Details

Ubuntu 14.04

Scenario:

Steps to Reproduce:

include recipe[squid] in your runlist

Expected Result:

cookbook [squid] runs successfully

Actual Result:

NameError

uninitialized constant Opscode::Squid

Squid fails to start on CentOS 5

     * service[squid] action start

       ================================================================================
       Error executing action `start` on resource 'service[squid]'
       ================================================================================

       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '134'
       ---- Begin output of /sbin/service squid start ----
       STDOUT: init_cache_dir /var/spool/squid... Starting squid: [FAILED]
       STDERR: /etc/init.d/squid: line 62:  4353 Aborted                 $SQUID -z -F -D >> /var/log/squid/squid.out 2>&1
       /etc/init.d/squid: line 42:  4354 Aborted                 $SQUID $SQUID_OPTS >> /var/log/squid/squid.out 2>&1
       ---- End output of /sbin/service squid start ----
       Ran /sbin/service squid start returned 134

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/squid/recipes/default.rb

        86: service node['squid']['service_name'] do
        87:   supports :restart => true, :status => true, :reload => true
        88:   provider Chef::Provider::Service::Upstart if platform?('ubuntu')
        89:   action [:enable, :start]
        90: end

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/squid/recipes/default.rb:86:in `from_file'

       service("squid") do
         action [:enable, :start]
         supports {:restart=>true, :status=>true, :reload=>true}
         retries 0
         retry_delay 2
         default_guard_interpreter :default
         service_name "squid"
         enabled true
         pattern "squid"
         declared_type :service
         cookbook_name "squid"
         recipe_name "default"
       end

     * service[squid] action reload (up to date)

   Running handlers:
   [2015-09-02T00:58:18+00:00] ERROR: Running exception handlers
   Running handlers complete
   [2015-09-02T00:58:18+00:00] ERROR: Exception handlers complete
   Chef Client failed. 1 resources updated in 1.822361 seconds
   [2015-09-02T00:58:18+00:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
   [2015-09-02T00:58:18+00:00] ERROR: service[squid] (squid::default line 86) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '134'
   ---- Begin output of /sbin/service squid start ----
   STDOUT: init_cache_dir /var/spool/squid... Starting squid: [FAILED]
   STDERR: /etc/init.d/squid: line 62:  4353 Aborted                 $SQUID -z -F -D >> /var/log/squid/squid.out 2>&1
   /etc/init.d/squid: line 42:  4354 Aborted                 $SQUID $SQUID_OPTS >> /var/log/squid/squid.out 2>&1
   ---- End output of /sbin/service squid start ----
   Ran /sbin/service squid start returned 134
   [2015-09-02T00:58:18+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

default recipe doesn't allow us to use proxy server from squid itself

I'm thinking the correct 'fix' is in the squid.conf.erb, but I got around our issue by adding in a hacky databag entry. For some reason (I fully don't grock IPV6/netmasks very well) we needed to have a
'::1' on the localhost entry. I added in to

squid_hosts:
{
"type": "src",
"id": "correct_localhost",
"net": [
"127.0.0.1/32 ::1"
]
}

and to
squid_acls:

{
"id": "correct_localhost",
"acl": [
[
"all",
"allow"
]
]
}

Failure on Ubuntu 20.04 / Debian 10

๐Ÿ—ฃ๏ธ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

๐Ÿ‘ป Brief Description

Running on Ubuntu 20.04 or Debian 10 fails to converge.

๐Ÿฅž Cookbook version

4.3.1

๐Ÿ‘ฉโ€๐Ÿณ Chef-Infra Version

16.8.14

๐ŸŽฉ Platform details

  • Ubuntu 20.04
  • Debian 10

It works on both Ubuntu 18.04 and Debian 9.

Steps To Reproduce

Steps to reproduce the behavior:

  1. In a simple wrapper:
apt_update
include_recipe 'squid'
  1. kitchen converge

๐Ÿš“ Expected behavior

Succesful converge

โž• Additional context

This is the failure:

  * execute[initialize squid cache dir] action run
           
           ================================================================================
           Error executing action `run` on resource 'execute[initialize squid cache dir]'
           ================================================================================
           
           Mixlib::ShellOut::ShellCommandFailed
           ------------------------------------
           Expected process to exit with [0], but received '255'
           ---- Begin output of squid -Nz ----
           STDOUT: 
           STDERR: 2020/12/21 22:13:58| FATAL: Squid is already running: Found fresh instance PID file (/var/run/squid.pid) with PID 1542
        exception location: Instance.cc(121) ThrowIfAlreadyRunningWith
           ---- End output of squid -Nz ----
           Ran squid -Nz returned 255

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.