diff --git a/varnish/files/varnish.conf b/varnish/files/varnish.conf new file mode 100644 index 00000000..d1f113c2 --- /dev/null +++ b/varnish/files/varnish.conf @@ -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 diff --git a/varnish/tasks/main.yml b/varnish/tasks/main.yml index d73b588e..0274f765 100644 --- a/varnish/tasks/main.yml +++ b/varnish/tasks/main.yml @@ -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" }