Git Product home page Git Product logo

ansible-squid's Introduction

README.md

Ansible Role: squid

A simple yet useful role to configure squid server. A working proxy can be set up with minimal effort. This role tries to balance the sensible defaults distributed with squid but with the option to extended them or disregard them. This role also allows for multiple http and https ports to be configured along with all the usual things like acls and http_access rules.

Tested on openSUSE and on CentOS. Should work on most platforms. Requires Ansible version >=2.0

Role Variables

The current defaults can be found in defaults/main.yml - These should be mostly self explanatory.

squid_acl_localnet - a list defining the src network values for the default acl "allow localnet" - does not have to be set but the reference to the acl in http_access must be removed.

squid_default_acl - populated with the distributed squid default acl

squid_custom_acl - defines an additional acl

squid_http_access - populated with the default http_access rules. Any additional rules must refined the entire list

squid_http_ports - a list of http_port parameters to use. Defaults to 3128. Redefine as an empty list to not listen with http. Use this to run on multiple ports

squid_https_ports - a list of https_port parameters to use e.g. "3129 cert=/etc/squid/squid.crt"

squid_access_log - set a value for access_log

squid_cache_dir - set a value for squid_cache_dir

squid_coredump_dir - sets the associated value, defaults to /var/cache/squid - likely to be useful on different platforms that use a different value

squid_custom_refresh_patterns - a list of additional refresh pattern parameters

squid_default_refresh_patterns - a list populated with the default refresh pattern parameters

Examples

Bare minimum

Setting just squid_acl_localnet will provide a working squid proxy

---
squid_acl_localnet: 
 - 10.1.2.0/24

Custom acl and redefined http_access

A contrite example but one that does demonstrate how to set acls in addition to the default and with a new http_access ruleset. Notice also that squid_acl_localnet is set to an empty list as this acl is not used in http_access

---
squid_acl_localnet:

squid_custom_acl:
  - homeworker src 1.2.3.4
  - homeworker src 7.8.9.10
  - restricted_sites dstdomain .bbc.co.uk

squid_http_access:
  - deny !Safe_ports
  - deny CONNECT !SSL_ports
  - allow localhost manager
  - deny manager
  - deny to_localhost
  - deny homeworker restricted_sites
  - allow homeworker
  - allow localhost
  - deny all

https only proxy with no access logging

---
squid_acl_localnet:
  - 10.1.2.0/24
  - 10.2.3.0/24

squid_http_ports:

squid_https_ports:
  - 3129 cert=/etc/squid/squid.crt

squid_access_log: none

License

MIT

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.