File tree Expand file tree Collapse file tree 6 files changed +37
-24
lines changed Expand file tree Collapse file tree 6 files changed +37
-24
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
varnish_package_name : " varnish"
3
+ varnish_modules_package_name : " "
3
4
varnish_version : " 6.4"
4
5
5
6
varnish_use_default_vcl : true
@@ -25,6 +26,9 @@ varnishd_extra_options: ""
25
26
varnish_enabled_services :
26
27
- varnish
27
28
29
+ # Use Packagecloud repo instead of distribution default
30
+ varnish_apt_use_packagecloud : true
31
+
28
32
# Make sure Packagecloud repo is used on RHEL/CentOS.
29
33
varnish_packagecloud_repo_yum_repository_priority : " 1"
30
34
Original file line number Diff line number Diff line change 14
14
15
15
- name : Ensure Varnish config path exists.
16
16
file :
17
- path : " {{ varnish_config_path }}"
17
+ path : " {{ varnish_systemd_override_path }}"
18
18
state : directory
19
19
mode : 0755
20
20
30
30
(ansible_os_family == 'Debian' and ansible_distribution_release != "xenial")
31
31
notify : restart varnish
32
32
33
- - name : Copy Debian Jessie/Xenial specific Varnish configs ( systemd) .
33
+ - name : Copy override for systemd unit .
34
34
template :
35
35
src : varnish.service.j2
36
- dest : " {{ varnish_systemd_config_path }}/varnish.service"
36
+ dest : " {{ varnish_systemd_override_path }}/varnish.service"
37
37
owner : root
38
38
group : root
39
39
mode : 0644
Original file line number Diff line number Diff line change 1
1
---
2
- - name : Ensure dependencies are present.
3
- apt :
4
- name :
5
- - apt-transport-https
6
- - gnupg2
7
- state : present
2
+ - name : Configure packagecloud.io repository
3
+ block :
4
+ - name : Ensure dependencies are present.
5
+ apt :
6
+ name :
7
+ - apt-transport-https
8
+ - gnupg2
9
+ state : present
8
10
9
- - name : Add packagecloud.io Varnish apt key.
10
- apt_key :
11
- url : https://packagecloud.io/varnishcache/{{ varnish_packagecloud_repo }}/gpgkey
12
- state : present
11
+ - name : Add packagecloud.io Varnish apt key.
12
+ apt_key :
13
+ url : https://packagecloud.io/varnishcache/{{ varnish_packagecloud_repo }}/gpgkey
14
+ state : present
13
15
14
- - name : Add packagecloud.io Varnish apt repository.
15
- apt_repository :
16
- repo : " {{ varnish_apt_repo }}"
17
- state : present
16
+ - name : Add packagecloud.io Varnish apt repository.
17
+ apt_repository :
18
+ repo : " {{ varnish_apt_repo }}"
19
+ state : present
20
+ when : varnish_apt_use_packagecloud
18
21
19
22
- name : Ensure Varnish is installed.
20
23
apt :
21
24
name : " {{ varnish_package_name }}"
22
25
state : present
23
26
24
- - name : Ensure old role-managed Varnish systemd unit file is removed .
25
- file :
26
- path : /etc/systemd/system/varnish.service
27
- state : absent
28
- when : varnish_systemd_config_path != '/etc/systemd/system'
27
+ - name : Ensure Varnish VMODs are installed .
28
+ apt :
29
+ name : " {{ varnish_modules_package_name }} "
30
+ state : present
31
+ when : varnish_modules_package_name
Original file line number Diff line number Diff line change 41
41
yum :
42
42
name : " {{ varnish_package_name }}"
43
43
state : present
44
+
45
+ - name : Ensure Varnish VMODs are installed.
46
+ yum :
47
+ name : " {{ varnish_modules_package_name }}"
48
+ state : present
49
+ when : varnish_modules_package_name
Original file line number Diff line number Diff line change 1
1
---
2
2
varnish_sysvinit_config_path : /etc/default
3
- varnish_systemd_config_path : /lib /systemd/system
3
+ varnish_systemd_override_path : /etc /systemd/system
Original file line number Diff line number Diff line change 1
1
---
2
2
varnish_sysvinit_config_path : /etc/sysconfig
3
- varnish_systemd_config_path : /usr/lib /systemd/system
3
+ varnish_systemd_override_path : /etc /systemd/system
You can’t perform that action at this time.
0 commit comments