Private
Public Access
2
0

squid: add role

This commit is contained in:
2026-02-05 09:52:04 +03:00
parent 34f208b75b
commit eecd5e9972
7 changed files with 9440 additions and 3 deletions

View File

@@ -10,6 +10,10 @@ ubuntu24:
vars:
ansible_python_interpreter: "/usr/bin/python3.12"
proxy:
hosts:
proxy1:
waf:
hosts:
waf1:

View File

@@ -24,6 +24,20 @@
tags:
- "local_ca"
- name: Proxy server
hosts: proxy
gather_facts: false
vars_files:
- "vars/common.yml"
- "vars/secrets.yml"
vars:
squid_authorized_networks:
- "{{ ansible_default_ipv4.network }}/24"
roles:
- "squid"
tags:
- "proxy"
- name: Common
hosts: all
gather_facts: false
@@ -31,6 +45,7 @@
- "vars/common.yml"
- "vars/secrets.yml"
vars:
common_proxy_server: "{{ hostvars['proxy1'].ansible_default_ipv4.address }}:3128"
common_default_packages:
- "net-tools"
- "htop"
@@ -99,15 +114,15 @@
- name: "{{ common.consul.datacenter }}.{{ common.consul.domain }}"
stub_to: "127.0.0.1@8600"
caddy_sites: "{{ common.sites }}"
ovh_ldp_cluster: "gra2.logs.ovh.com"
ovh_ldp_token: "{{ secrets.ovh_ldp.token }}"
# ovh_ldp_cluster: "gra2.logs.ovh.com"
# ovh_ldp_token: "{{ secrets.ovh_ldp.token }}"
roles:
- "local_ca_certs"
- "consul"
- "caddy"
# - "keepalived"
- "unbound"
- "ovh_ldp"
# - "ovh_ldp"
tags:
- "waf"

View File

@@ -1,4 +1,7 @@
vms = {
proxy1 = {
disk = "20g"
},
waf1 = {},
waf2 = {},
waf3 = {},

View File

@@ -0,0 +1,2 @@
squid_authorized_networks: ["127.0.0.1"]
squid_cache_size: 10240

View File

@@ -0,0 +1,4 @@
- name: Restart squid
ansible.builtin.systemd:
name: "squid"
state: "restarted"

View File

@@ -0,0 +1,23 @@
- name: Install squid package
ansible.builtin.apt:
name: "squid"
notify:
- "Restart squid"
- name: Deploy squid configuration file
ansible.builtin.template:
src: "templates/squid.conf"
dest: "/etc/squid/squid.conf"
owner: "root"
group: "root"
mode: "0644"
notify:
- "Restart squid"
- name: Enable squid
ansible.builtin.systemd:
name: "squid"
enabled: true
daemon_reload: true
notify:
- "Restart squid"

File diff suppressed because it is too large Load Diff