squid: compatibility wit Debian 10
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Jérémy Lecour 2019-10-24 16:23:48 +02:00 committed by Jérémy Lecour
parent a9b61161e0
commit 27adad616f
4 changed files with 22 additions and 33 deletions

View file

@ -44,7 +44,7 @@ The **patch** part changes incrementally at each release.
* php: Don't set a chroot for the default fpm pool
* rbenv: install Ruby 2.6.5 by default
* squid: Remove wait time when we turn off squid
* squid: split systemd tasks into own file
* squid: compatibility wit Debian 10
* varnish: remove custom ExecReload= script for Debian 10+
### Fixed

View file

@ -1,22 +0,0 @@
## 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

@ -0,0 +1,4 @@
# systemd override for Squid
[Service]
ExecStart=
ExecStart=/usr/sbin/squid -sYC -f /etc/squid/evolinux-defaults.conf

View file

@ -4,21 +4,28 @@
command: systemctl -q is-active squid.service
changed_when: False
failed_when: False
register: squid_systemd_active
register: _squid_systemd_active
- name: Squid systemd overrides directory exists
file:
dest: /etc/systemd/system/squid.service.d/
state: directory
owner: root
group: root
mode: "0755"
- name: "Squid systemd unit service is present (Debian 10 or later)"
- name: "Squid systemd unit service is present"
copy:
src: squid.service
dest: /etc/systemd/system/squid.service
when:
- ansible_distribution_major_version | version_compare('10', '>=')
- squid_systemd_active.rc != 0
src: systemd-override.conf
dest: /etc/systemd/system/squid.service.d/override.conf
force: yes
register: _squid_systemd_override
- name: "Systemd is reload and Squid restarted (Debian 10 or later)"
- name: "Systemd daemon is reloaded and Squid restarted"
systemd:
name: squid
state: restarted
daemon_reload: yes
when:
- ansible_distribution_major_version | version_compare('10', '>=')
- squid_systemd_active.rc != 0
- _squid_systemd_active.rc == 0
- _squid_systemd_override.changed