robertdebock.squid

Ansible 角色 squid

在您的系统上安装和配置 squid

GitHub GitLab 下载量 版本
github gitlab downloads Version

示例剧本

该示例来自 molecule/default/converge.yml,并在每次推送、拉取请求和发布时进行了测试。

---
- 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

机器需要进行准备。在 CI 中,这通过 molecule/default/prepare.yml 完成:

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

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

有关如何使用这些角色的详细说明和示例

角色变量

变量的默认值在 defaults/main.yml 中设置:

---
# squid 的默认文件

# squid 监听的端口。
squid_port: 3128

# 缓存的目录(和方式)。
squid_cache_dir: ufs /var/spool/squid 100 16 256

# squid 日志文件的位置
squid_access_log: /var/log/squid/access.log

需求

使用的角色状态

以下角色用于准备系统。您可以使用其他方式准备系统。

需求 GitHub GitLab
robertdebock.bootstrap Build Status GitHub Build Status GitLab
robertdebock.core_dependencies Build Status GitHub Build Status GitLab

上下文

此角色是许多兼容角色的一部分。有关更多信息,请查看这些角色的文档

以下是相关角色的概览: 依赖关系

兼容性

此角色已在以下 容器映像 上进行了测试:

容器 标签
Alpine 所有
Amazon 候选
EL 9
Debian 所有
Fedora 所有
Ubuntu 所有

所需的 Ansible 最低版本为 2.12,测试已完成于:

  • 先前版本。
  • 当前版本。
  • 开发版本。

如果您发现问题,请在 GitHub 中报告。

许可证

Apache-2.0

作者信息

robertdebock

请考虑赞助我

关于项目

Install and configure squid on your system

安装
ansible-galaxy install robertdebock.squid
许可证
apache-2.0
下载
55.8k
拥有者
I know my way around (Linux) infrastructure, have a passion for automation, Docker, Ansible, Molecule and ci/cd.