robertdebock.squid

Ansible Role Squid

This guide will help you install and set up Squid on your system.

GitHub GitLab Downloads Version
GitHub GitLab Downloads Version

Example Playbook

Here is a simple playbook to set up Squid. This example is from molecule/default/converge.yml and is tested whenever there is a push, pull request, or release.

---
- name: Converge
  hosts: all
  become: true
  gather_facts: true

  roles:
    - role: robertdebock.squid
      squid_cache_dir: "aufs /var/spool/squid 16000 16 256 max-size=8589934592"
      squid_cache_replacement_policy: heap LFUDA
      squid_maximum_object_size_mb: 256
      squid_acls:
        - name: localnet
          classifier: src
          value: "0.0.0.1-0.255.255.255"
      squid_rules:
        - acl: to_localhost
          decision: deny
        - acl: localnet
          decision: allow
        - acl: localhost
          decision: allow
        - acl: all
          decision: deny

Make sure your machine is ready. In CI, you can prepare it using molecule/default/prepare.yml:

---
- name: Prepare
  hosts: all
  become: true
  gather_facts: false

  roles:
    - role: robertdebock.bootstrap
    - role: robertdebock.core_dependencies

For more details, check this full explanation and example of how to use these roles.

Role Variables

Default variable values are set in defaults/main.yml:

---
# Default settings for Squid

# The port on which Squid listens.
squid_port: 3128

# The directory and method for caching.
squid_cache_dir: ufs /var/spool/squid 100 16 256

# The location of Squid's log file
squid_access_log: /var/log/squid/access.log

Requirements

State of Used Roles

To get your system ready, the following roles are used. You can find alternate preparation methods as well.

Requirement GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab
robertdebock.core_dependencies Build Status GitHub Build Status GitLab

Context

This role works with many other roles. Check the documentation of these roles for more information.

Overview of related roles: Dependencies

Compatibility

This role has been tested on the following container images:

Container Tags
Alpine All
Amazon Candidate
EL 9
Debian All
Fedora All
Ubuntu All

You need Ansible version 2.12 or higher. Tests have been conducted on:

  • Previous versions.
  • The current version.
  • The development version.

If you encounter any problems, please report them on GitHub.

License

This project is licensed under Apache-2.0.

Author Information

Written by robertdebock.

Consider sponsoring me if you find this useful.

Informazioni sul progetto

Install and configure squid on your system

Installa
ansible-galaxy install robertdebock.squid
Licenza
apache-2.0
Download
55.8k
Proprietario
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.