Browse Source

varnish: config file name is configurable

pull/119/head
Jérémy Lecour 3 months ago
committed by Jérémy Lecour
parent
commit
8861169a04
4 changed files with 9 additions and 8 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +0
    -5
      varnish/files/reload-vcl.sh
  3. +3
    -3
      varnish/tasks/main.yml
  4. +5
    -0
      varnish/templates/reload-vcl.sh.j2

+ 1
- 0
CHANGELOG.md View File

@ -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


+ 0
- 5
varnish/files/reload-vcl.sh View File

@ -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"

+ 3
- 3
varnish/tasks/main.yml View File

@ -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
- 0
varnish/templates/reload-vcl.sh.j2 View File

@ -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