summaryrefslogtreecommitdiffstats
path: root/roles/varnish/tasks/main.yml
blob: 14ce35971441e11156e81a8134bdb0cf75109fc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
# Tasks to set up varnish

- name: install needed packages
  package: pkg={{ item }} state=installed
  with_items:
  - varnish
  tags:
  - varnish
  - packages

- name: set some varnishd selinux boolean
  seboolean: name=varnishd_connect_any persistent=yes state=yes
  tags:
  - varnish
  - selinux

- name: install varnish /etc/sysconfig/varnish file (el7
  copy: src=varnish.el7 dest=/etc/sysconfig/varnish owner=root group=root
  notify:
  - restart varnish
  tags:
  - varnish
  when: ansible_distribution_major_version|int == 7

- name: install varnish /etc/sysconfig/varnish file (fedora)
  template: src=varnish.f25.j2 dest=/etc/varnish/varnish.params owner=root group=root
  notify:
  - restart varnish
  tags:
  - varnish
  when: ansible_distribution_major_version|int > 24

- name: install /etc/varnish/default.vcl (proxies)
  template: src={{ varnish_group }}.vcl.j2 dest=/etc/varnish/default.vcl owner=root group=root
  notify:
  - restart varnish
  tags:
  - varnish

- name: make sure varnish is set to enabled on boot
  service: enabled=yes name=varnish
  tags:
  - varnish