diff --git a/CHANGELOG.md b/CHANGELOG.md index e4ecf202..463d3a83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ The **patch** part changes incrementally at each release. * tomcat-instance: fail if uid already exists * varnish: change template name for better readability * varnish: no threadpool delay by default +* varnish: no custom reload script for Debian 10 and later ### Fixed diff --git a/varnish/tasks/main.yml b/varnish/tasks/main.yml index 38066298..7274cba8 100644 --- a/varnish/tasks/main.yml +++ b/varnish/tasks/main.yml @@ -18,14 +18,14 @@ tags: - varnish -- name: Copy Custom Varnish ExecReload script (Debian <=9) +- name: Copy Custom Varnish ExecReload script (Debian <10) template: src: "reload-vcl.sh.j2" dest: "/etc/varnish/reload-vcl.sh" mode: "0700" owner: root group: root - when: ansible_distribution_major_version is version('9', '<=') + when: ansible_distribution_major_version is version('10', '<') notify: reload varnish tags: - varnish @@ -37,11 +37,24 @@ tags: - varnish -- name: Override Varnish systemd unit +- name: Override Varnish systemd unit (Stretch and before) template: - src: varnish.conf.j2 + src: varnish.conf.jessie.j2 dest: /etc/systemd/system/varnish.service.d/evolinux.conf force: yes + when: ansible_distribution_major_version is version('10', '<') + notify: + - reload systemd + - restart varnish + tags: + - varnish + +- name: Override Varnish systemd unit (Buster and later) + template: + src: varnish.conf.buster.j2 + dest: /etc/systemd/system/varnish.service.d/evolinux.conf + force: yes + when: ansible_distribution_major_version is version('10', '>=') notify: - reload systemd - restart varnish diff --git a/varnish/templates/varnish.conf.buster.j2 b/varnish/templates/varnish.conf.buster.j2 new file mode 100644 index 00000000..09dcf7c4 --- /dev/null +++ b/varnish/templates/varnish.conf.buster.j2 @@ -0,0 +1,5 @@ +# {{ ansible_managed }} + +[Service] +ExecStart= +ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F {{ varnish_addresses | map('regex_replace', '^(.*)$', '-a \\1') | list | join(' ') }} -T {{ varnish_management_address }} -f {{ varnish_config_file }} -S {{ varnish_secret_file }} -s {{ varnish_storage }} -p thread_pools={{ varnish_thread_pools }} -p thread_pool_add_delay={{ varnish_thread_pool_add_delay }} -p thread_pool_min={{ varnish_thread_pool_min }} -p thread_pool_max={{ varnish_thread_pool_max }} diff --git a/varnish/templates/varnish.conf.j2 b/varnish/templates/varnish.conf.j2 deleted file mode 100644 index 3020d556..00000000 --- a/varnish/templates/varnish.conf.j2 +++ /dev/null @@ -1,7 +0,0 @@ -# {{ ansible_managed }} - -[Service] -ExecStart= -ExecStart=/usr/sbin/varnishd -F {{ varnish_addresses | map('regex_replace', '^(.*)$', '-a \\1') | list | join(' ') }} -T {{ varnish_management_address }} -f {{ varnish_config_file }} -S {{ varnish_secret_file }} -s {{ varnish_storage }} -p thread_pools={{ varnish_thread_pools }} -p thread_pool_add_delay={{ varnish_thread_pool_add_delay }} -p thread_pool_min={{ varnish_thread_pool_min }} -p thread_pool_max={{ varnish_thread_pool_max }} -ExecReload= -ExecReload=/etc/varnish/reload-vcl.sh diff --git a/varnish/templates/varnish.conf.jessie.j2 b/varnish/templates/varnish.conf.jessie.j2 new file mode 100644 index 00000000..59651b36 --- /dev/null +++ b/varnish/templates/varnish.conf.jessie.j2 @@ -0,0 +1,7 @@ +# {{ ansible_managed }} + +[Service] +ExecStart= +ExecStart=/usr/sbin/varnishd -j unix,user=vcache -F {{ varnish_addresses | map('regex_replace', '^(.*)$', '-a \\1') | list | join(' ') }} -T {{ varnish_management_address }} -f {{ varnish_config_file }} -S {{ varnish_secret_file }} -s {{ varnish_storage }} -p thread_pools={{ varnish_thread_pools }} -p thread_pool_add_delay={{ varnish_thread_pool_add_delay }} -p thread_pool_min={{ varnish_thread_pool_min }} -p thread_pool_max={{ varnish_thread_pool_max }} +ExecReload= +ExecReload=/etc/varnish/reload-vcl.sh