Skip to content
This repository was archived by the owner on Feb 13, 2023. It is now read-only.

Commit fd73329

Browse files
committed
Update Varnish role to work on CentOS 8.
1 parent 29937e4 commit fd73329

File tree

6 files changed

+24
-18
lines changed

6 files changed

+24
-18
lines changed

provisioning/requirements.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,4 @@ roles:
7979
- name: geerlingguy.solr
8080
version: 5.1.0
8181
- name: geerlingguy.varnish
82-
version: 3.2.0
82+
version: 3.3.0

provisioning/roles/geerlingguy.varnish/.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ env:
66
global:
77
- ROLE_NAME: varnish
88
matrix:
9-
# - MOLECULE_DISTRO: centos8
9+
- MOLECULE_DISTRO: centos8
1010
- MOLECULE_DISTRO: centos7
1111
- MOLECULE_DISTRO: ubuntu1804
1212
- MOLECULE_DISTRO: ubuntu1604

provisioning/roles/geerlingguy.varnish/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ Available variables are listed below, along with default values (see `defaults/m
1616

1717
Varnish package name you want to install. See `apt-cache policy varnish` or `yum list varnish` for a listing of available candidates.
1818

19-
varnish_version: "6.1"
19+
varnish_version: "6.4"
2020

21-
Varnish version that should be installed. See the [Varnish Cache packagecloud.io repositories](https://packagecloud.io/varnishcache) for a listing of available versions. Some examples include: `6.1`, `6.0`, `5.1`, `4.1`, `3.0`, and `2.1`.
21+
Varnish version that should be installed. See the [Varnish Cache packagecloud.io repositories](https://packagecloud.io/varnishcache) for a listing of available versions. Some examples include: `6.4`, `6.3`, `6.1`, `4.1`, `3.0`, and `2.1`.
2222

2323
varnish_config_path: /etc/varnish
2424

provisioning/roles/geerlingguy.varnish/meta/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ galaxy_info:
1313
versions:
1414
- 6
1515
- 7
16-
# - 8
16+
- 8
1717
- name: Ubuntu
1818
versions:
1919
- precise

provisioning/roles/geerlingguy.varnish/molecule/default/converge.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
pre_tasks:
77
- import_tasks: playbook-setup.yml
88

9-
- name: Set older Varnish version for older OSes.
10-
set_fact:
11-
varnish_version: "5.1"
12-
when: >
13-
(ansible_os_family == 'RedHat' and ansible_distribution_major_version|int < 7) or
14-
(ansible_distribution == 'Ubuntu' and ansible_distribution_major_version|int < 16) or
15-
(ansible_distribution == 'Debian' and ansible_distribution_major_version|int < 9)
16-
179
roles:
1810
- role: geerlingguy.varnish
1911

provisioning/roles/geerlingguy.varnish/tasks/setup-RedHat.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
2-
- name: Ensure Varnish dependencies are installed.
2+
- name: Ensure Varnish dependency is installed.
33
yum:
4-
name:
5-
- yum-utils
6-
- pygpgme
4+
name: yum-utils
75
state: present
86

7+
- name: Ensure extra Varnish dependency on older RHEL versions is installed.
8+
yum:
9+
name: pygpgme
10+
state: present
11+
when: ansible_distribution_major_version | int < 8
12+
913
- name: Add Varnish packagecloud.io yum repo.
1014
yum_repository:
1115
name: varnishcache_{{ varnish_packagecloud_repo }}
@@ -21,12 +25,22 @@
2125
register: varnish_packagecloud_repo_addition
2226

2327
- name: Refresh yum metadata cache if repo changed.
24-
command: yum clean metadata
28+
command: >
29+
yum -q makecache -y --disablerepo='*' --enablerepo='varnishcache_{{ varnish_packagecloud_repo }}'
2530
args:
2631
warn: false
2732
when: varnish_packagecloud_repo_addition.changed
2833
tags: ['skip_ansible_lint']
2934

35+
- name: Disable varnish AppStream in RHEL 8.
36+
command: dnf module disable -y varnish
37+
args:
38+
warn: false
39+
when:
40+
- varnish_packagecloud_repo_addition.changed
41+
- ansible_distribution_major_version | int == 8
42+
tags: ['skip_ansible_lint']
43+
3044
- name: Ensure Varnish is installed.
3145
yum:
3246
name: "{{ varnish_package_name }}"

0 commit comments

Comments
 (0)