ansible-roles/varnish/tasks/main.yml
Romain Dessort 4be248ce58 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.
2017-03-15 18:01:33 -04:00

31 lines
673 B
YAML

---
- name: Install Varnish
apt:
name: varnish
state: present
- name: Remove default varnish configuration files
file:
path: "{{ item }}"
state: absent
with_fileglob: "/etc/defaults/varnish*"
- name: Copy Custom Varnish ExecReload script
copy:
src: "reload-vcl.sh"
dest: "/etc/varnish/reload-vcl.sh"
mode: "700"
owner: root
group: root
- name: Create a system config directory for systemd overrides
file:
path: /etc/systemd/system/varnish.service.d
state: directory
- name: Modify Varnish configuration files
copy:
src: varnish.conf
dest: /etc/systemd/system/varnish.service.d/
notify: reload systemctl