forked from evolix/ansible-roles
parent
d5751150af
commit
bb288ca991
22
squid/files/squid.service
Normal file
22
squid/files/squid.service
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
## Copyright (C) 1996-2019 The Squid Software Foundation and contributors
|
||||||
|
##
|
||||||
|
## Squid software is distributed under GPLv2+ license and includes
|
||||||
|
## contributions from numerous individuals and organizations.
|
||||||
|
## Please see the COPYING and CONTRIBUTORS files for details.
|
||||||
|
##
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Squid Web Proxy Server
|
||||||
|
Documentation=man:squid(8)
|
||||||
|
After=network.target network-online.target nss-lookup.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
PIDFile=/var/run/squid.pid
|
||||||
|
ExecStartPre=/usr/sbin/squid --foreground -z
|
||||||
|
ExecStart=/usr/sbin/squid -sYC -f /etc/squid/evolinux-defaults.conf
|
||||||
|
ExecReload=/bin/kill -HUP $MAINPID
|
||||||
|
KillMode=mixed
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -29,6 +29,12 @@
|
||||||
dest: /etc/default/squid
|
dest: /etc/default/squid
|
||||||
when: ansible_distribution_major_version | version_compare('9', '>=')
|
when: ansible_distribution_major_version | version_compare('9', '>=')
|
||||||
|
|
||||||
|
- name: "Set custom systemd unit service (Debian 10 or later)"
|
||||||
|
copy:
|
||||||
|
src: squid.service
|
||||||
|
dst: /etc/systemd/system/squid.service
|
||||||
|
when: ansible_distribution_major_version | version_compare('10', '>=')
|
||||||
|
|
||||||
- name: "squid.conf is present (jessie)"
|
- name: "squid.conf is present (jessie)"
|
||||||
template:
|
template:
|
||||||
src: squid.conf.j2
|
src: squid.conf.j2
|
||||||
|
@ -134,6 +140,13 @@
|
||||||
notify: "reload squid"
|
notify: "reload squid"
|
||||||
when: ansible_distribution_major_version | version_compare('9', '>=')
|
when: ansible_distribution_major_version | version_compare('9', '>=')
|
||||||
|
|
||||||
|
- name: "Reload systemd and restart squid (Debian 10 or later)"
|
||||||
|
systemd:
|
||||||
|
name: squid
|
||||||
|
state: restarted
|
||||||
|
daemon_reload: yes
|
||||||
|
when: ansible_distribution_major_version | version_compare('10', '>=')
|
||||||
|
|
||||||
- include: logrotate_jessie.yml
|
- include: logrotate_jessie.yml
|
||||||
when: ansible_distribution_release == "jessie"
|
when: ansible_distribution_release == "jessie"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue