ansible-roles/varnish/tasks/main.yml

31 lines
674 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: "0700"
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