Fix Varnish systemd unit

We need to switch to copy module instead of ini_file since it doe not
support putting the same key multiple times in a section.
This commit is contained in:
Romain Dessort 2017-03-15 18:01:33 -04:00
parent 6b3b693501
commit 4be248ce58
2 changed files with 7 additions and 8 deletions

View File

@ -0,0 +1,4 @@
[Service]
ExecStart=
ExecStart=/usr/sbin/varnishd -a 0.0.0.0:80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,2G -p thread_pools=2 -p thread_pool_add_delay=2 -p thread_pool_min=500 -p thread_pool_max=5000
ExecReload=/etc/varnish/reload-vcl.sh

View File

@ -24,12 +24,7 @@
state: directory
- name: Modify Varnish configuration files
ini_file:
dest: /etc/systemd/system/varnish.service.d/varnish.conf
section: Service
option: "{{ item.option }}"
value: "{{ item.value }}"
copy:
src: varnish.conf
dest: /etc/systemd/system/varnish.service.d/
notify: reload systemctl
with_items:
- { option: ExecStart, value: "/usr/sbin/varnishd -a 0.0.0.0:80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,{{ malloc }} -p thread_pools={{ thread_pools }} -p thread_pool_add_delay=2 -p thread_pool_min=500 -p thread_pool_max=5000 "}
- { option: ExecReload, value: "/etc/varnish/reload-vcl.sh" }