Browse Source

varnish: config file name is configurable

pull/119/head
Jérémy Lecour 1 year ago
committed by Jérémy Lecour
parent
commit
8861169a04
  1. 1
      CHANGELOG.md
  2. 5
      varnish/files/reload-vcl.sh
  3. 6
      varnish/tasks/main.yml
  4. 5
      varnish/templates/reload-vcl.sh.j2

1
CHANGELOG.md

@ -23,6 +23,7 @@ The **patch** part changes incrementally at each release.
* redis: variable to force use of port 6379 in instances mode
* redis: check maxmemory in NRPE check
* lxc-php: Allow php containers to contact local MySQL with localhost
* varnish: config file name is configurable
### Changed

5
varnish/files/reload-vcl.sh

@ -1,5 +0,0 @@
#!/bin/sh
UUID=`cat /proc/sys/kernel/random/uuid`
/usr/sbin/varnishd -C -f /etc/varnish/default.vcl >/dev/null \
&&/usr/bin/varnishadm -T localhost:6082 -S /etc/varnish/secret "vcl.load vcl_$UUID /etc/varnish/default.vcl" \
&& /usr/bin/varnishadm -T localhost:6082 -S /etc/varnish/secret "vcl.use vcl_$UUID"

6
varnish/tasks/main.yml

@ -19,8 +19,8 @@
- varnish
- name: Copy Custom Varnish ExecReload script (Debian <=9)
copy:
src: "reload-vcl.sh"
template:
src: "reload-vcl.sh.j2"
dest: "/etc/varnish/reload-vcl.sh"
mode: "0700"
owner: root
@ -62,7 +62,7 @@
- name: Copy Varnish configuration
template:
src: "{{ item }}"
dest: /etc/varnish/default.vcl
dest: "{{ varnish_config_file }}"
mode: "0644"
force: yes
with_first_found:

5
varnish/templates/reload-vcl.sh.j2

@ -0,0 +1,5 @@
#!/bin/sh
UUID=`cat /proc/sys/kernel/random/uuid`
/usr/sbin/varnishd -C -f {{ varnish_config_file }} >/dev/null \
&& /usr/bin/varnishadm -T {{ varnish_management_address }} -S {{ varnish_secret_file }} "vcl.load vcl_$UUID {{ varnish_config_file }}" \
&& /usr/bin/varnishadm -T {{ varnish_management_address }} -S {{ varnish_secret_file }} "vcl.use vcl_$UUID"
Loading…
Cancel
Save