squid: Custom systemd unit file for Debian >=10
Some checks reported errors
continuous-integration/drone/pr Build encountered an error
continuous-integration/drone/push Build is passing

Fixes #63
This commit is contained in:
Benoît S. 2019-07-03 10:07:00 +02:00
parent d5751150af
commit bb288ca991
2 changed files with 35 additions and 0 deletions

22
squid/files/squid.service Normal file
View 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

View file

@ -29,6 +29,12 @@
dest: /etc/default/squid
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)"
template:
src: squid.conf.j2
@ -134,6 +140,13 @@
notify: "reload squid"
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
when: ansible_distribution_release == "jessie"