Port varnish role to Fedora 29
From varnish changelog: - varnish.params is gone. To override startup configuration, use /etc/systemd/system/varnish.service
This commit is contained in:
parent
8da7c1ce6f
commit
22ec01c0f5
2 changed files with 27 additions and 3 deletions
|
@ -16,7 +16,7 @@
|
|||
- varnish
|
||||
- selinux
|
||||
|
||||
- name: install varnish /etc/sysconfig/varnish file (el7
|
||||
- name: install varnish /etc/sysconfig/varnish file (el7)
|
||||
copy: src=varnish.el7 dest=/etc/sysconfig/varnish owner=root group=root
|
||||
notify:
|
||||
- restart varnish
|
||||
|
@ -24,13 +24,21 @@
|
|||
- varnish
|
||||
when: ansible_distribution_major_version|int == 7
|
||||
|
||||
- name: install varnish /etc/sysconfig/varnish file (fedora)
|
||||
- name: install varnish /etc/sysconfig/varnish file (fedora 25-28)
|
||||
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
|
||||
when: ansible_distribution_major_version|int >= 25 and ansible_distribution_major_version|int < 29
|
||||
|
||||
- name: install varnish /etc/systemd/system/varnish.service file (fedora 29+)
|
||||
template: src=varnish.f29.j2 dest=/etc/systemd/system/varnish.service owner=root group=root
|
||||
notify:
|
||||
- restart varnish
|
||||
tags:
|
||||
- varnish
|
||||
when: ansible_distribution_major_version|int >= 29
|
||||
|
||||
- name: install /etc/varnish/default.vcl (proxies)
|
||||
template: src={{ varnish_group }}.vcl.j2 dest=/etc/varnish/default.vcl owner=root group=root
|
||||
|
|
16
roles/varnish/templates/varnish.f29.j2
Normal file
16
roles/varnish/templates/varnish.f29.j2
Normal file
|
@ -0,0 +1,16 @@
|
|||
{% if "proxy" in inventory_hostname %}
|
||||
{% set VARNISH_LISTEN_PORT=6081 %}
|
||||
{% else %}
|
||||
{% set VARNISH_LISTEN_PORT=80 %}
|
||||
{% endif %}
|
||||
|
||||
{% if varnish_group == 'kojipkgs' %}
|
||||
{% set VARNISH_STORAGE="malloc,48GB" %}
|
||||
{% elif varnish_group == 's390kojipkgs' %}
|
||||
{% set VARNISH_STORAGE="file,/var/lib/varnish/varnish_storage.bin,20G" %}
|
||||
{% else %}
|
||||
{% set VARNISH_STORAGE="malloc,256M" %}
|
||||
{% endif %}
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/sbin/varnishd -a :{{VARNISH_LISTEN_PORT}} -f /etc/varnish/default.vcl -s {{VARNISH_STORAGE}}
|
Loading…
Add table
Add a link
Reference in a new issue