Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ jobs:
matrix:
os:
- almalinux-8
# - amazonlinux-2
- debian-10
- almalinux-9
- debian-11
- centos-7
- centos-stream-8
# - fedora-latest
- ubuntu-1804
- debian-12
- centos-stream-9
- ubuntu-2004
- ubuntu-2204
- ubuntu-2404
- rockylinux-8
# - opensuse-leap-15
- rockylinux-9
suite:
- "varnish66"
- "varnish70"
- "varnish77"
- "distro"
- "full-stack"
exclude:
Expand Down
10 changes: 7 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

## Unreleased

Add new varnish releases

Make default 7.7.

## 5.0.20 - *2024-11-18*

Standardise files with files in sous-chefs/repo-management
Expand Down Expand Up @@ -228,7 +232,7 @@ Known Bugs:

## 2.2.2

- # 86 - Removed monkey patching of service providers
- Removed monkey patching of service providers (#86)

## 2.2.1

Expand Down Expand Up @@ -267,13 +271,13 @@ Known Bugs:

### Bug

- **[COOK-3531](https://tickets.chef.io/browse/COOK-3531)** - Fix default instance name
- [COOK-3531] - Fix default instance name

## 0.9.8

### Improvement

- **[COOK-3095](https://tickets.chef.io/browse/COOK-3095)** - Add MiniTest Chef Handler and Test Kitchen
- [COOK-3095] - Add MiniTest Chef Handler and Test Kitchen

## 0.9.6

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These attributes used as defaults for both resources and the `varnish::configure
- `node['varnish']['reload_cmd']` - location of the varnish reload script used by the systemd config file. This is not used for initd currently.
- `node['varnish']['conf_source']` - template file source to use for the `default` varnish init config.
- `node['varnish']['conf_cookbook']` - template cookbook source to use for the `default` varnish init config.
- `node['varnish']['major_version']` - the major version of varnish to install. Can be any valid major release. Defaults to 7.0.
- `node['varnish']['major_version']` - the major version of varnish to install. Can be any valid major release. Defaults to 7.7.

## Recipes

Expand Down
2 changes: 1 addition & 1 deletion attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
##

default['varnish']['conf_cookbook'] = 'varnish'
default['varnish']['major_version'] = 4.1
default['varnish']['major_version'] = 7.7

default['varnish']['configure']['repo']['action'] = :configure

Expand Down
4 changes: 2 additions & 2 deletions documentation/varnish_config.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Back to resource list](../README.md#resources)

# varnish_config

[Back to resource list](../README.md#resources)

Configures the Varnish service through the defaults or systemd init file. If you do not include this, the config files that come with your distro package will be used instead.

## Actions
Expand Down
6 changes: 3 additions & 3 deletions documentation/varnish_log.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Back to resource list](../README.md#resources)

# varnish_log

[Back to resource list](../README.md#resources)

Configures varnishlog or varnishncsa service. You can define both logfiles by calling `varnish_log` more than once. You can install logrotate config files if you wish as well.

## Actions
Expand All @@ -17,7 +17,7 @@ Configures varnishlog or varnishncsa service. You can define both logfiles by ca
| `file_name` | String | `'/var/log/varnish/varnishlog.log'` |
| `pid` | String | `'/var/run/varnishlog.pid'` |
| `log_format` | `'varnishlog'` or `'varnishncsa'` | `'varnishlog'` |
| `ncsa_format_string` | String | `'%h \| %l \| %u \| %t \| \"%r\" \| %s \| %b \| \"%{Referer}i\" | \"%{User-agent}i\"'` |
| `ncsa_format_string` | String | `'%h \| %l \| %u \| %t \| \"%r\" \| %s \| %b \| \"%{Referer}i\" \| \"%{User-agent}i\"'` |
| `instance_name` | String | name property |
| `logrotate` | `true`, `false` | `true` vanishlog, `false` for varnishncsa |
| `major_version` | Minor supported release | Currently installed major version (If varnish isn't installed yet then you will have to set this explicitly) |
Expand Down
4 changes: 2 additions & 2 deletions documentation/varnish_repo.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Back to resource list](../README.md#resources)

# varnish_repo

[Back to resource list](../README.md#resources)

Configure's the varnish vendor repo.

## Actions
Expand Down
4 changes: 2 additions & 2 deletions documentation/vcl_file.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Back to resource list](../README.md#resources)

# vcl_file

[Back to resource list](../README.md#resources)

Create vcl file at `/etc/varnish/default.vcl` using the file at `files/default/default.vcl`:

## Actions
Expand Down
4 changes: 2 additions & 2 deletions documentation/vcl_template.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[Back to resource list](../README.md#resources)

# vcl_template

[Back to resource list](../README.md#resources)

Create vcl file at `/etc/varnish/backends.vcl` using the template at `templates/default/backends.vcl.erb` and pass it some variables:

## Actions
Expand Down
6 changes: 3 additions & 3 deletions kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ suites:
version: 6.6
excludes:
- debian-11
- name: varnish70
- name: varnish77
run_list:
- recipe[install_varnish::vendor_install]
attributes:
varnish:
major_version: 7.0
major_version: 7.7
verifier:
inspec_tests:
- path: test/integration/varnish
inputs:
version: 7.0
version: 7.7
- name: distro
run_list:
- recipe[install_varnish::distro_install]
Expand Down
7 changes: 7 additions & 0 deletions libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ module Helpers
# rubocop:disable Style/ModuleFunction
extend self # Stubbing with module_function doesn't seem to work

def supported_major_versions
[
3.0, 4.0, 4.1, 5, 5.0, 5.1, 5.2, 6.0, 6.1, 6.2, 6.3,
6.4, 6.5, 6.6, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.6, 7.7
]
end

def installed_major_version
cmd_str = 'varnishd -V 2>&1'
cmd = shell_out!(cmd_str)
Expand Down
2 changes: 1 addition & 1 deletion resources/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
property :max_locked_memory, Integer, default: 82_000
property :instance_name, String, default: VarnishCookbook::Helpers.hostname
property :major_version, Float,
equal_to: [3.0, 4.0, 4.1, 5, 5.0, 5.1, 5.2, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 7.0],
equal_to: VarnishCookbook::Helpers.supported_major_versions,
default: lazy { VarnishCookbook::Helpers.installed_major_version }

# Daemon options
Expand Down
2 changes: 1 addition & 1 deletion resources/log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
property :instance_name, String, default: VarnishCookbook::Helpers.hostname

property :major_version, Float,
equal_to: [3.0, 4.0, 4.1, 5, 5.0, 5.1, 5.2, 6.0, 6.1, 6.2, 6.3, 6.4, 6.5, 6.6, 7.0],
equal_to: VarnishCookbook::Helpers.supported_major_versions,
default: lazy { VarnishCookbook::Helpers.installed_major_version }

property :ncsa_format_string, [String, nil], default: lazy {
Expand Down
2 changes: 1 addition & 1 deletion resources/varnish_repo_redhat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
action :configure do
dnf_module 'varnish' do
action :disable
only_if { node['platform_version'].to_i >= 8 }
only_if { node['platform_version'].to_i == 8 }
end

# packagecloud repos omit dot from major version
Expand Down
15 changes: 1 addition & 14 deletions test/integration/varnish/controls/default_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
version = input('version', value: 0)
ncsa_format_string = input('ncsa_format_string')
full_stack = input('full_stack')
os_family = os.family
os_release = os.release
os_name = os.name

control 'default' do
describe command 'varnishd -V' do
Expand Down Expand Up @@ -89,17 +86,7 @@

describe command "varnishadm #{varnishadm_opts} backend.list" do
its('exit_status') { should eq 0 }
if version.to_i >= 6
its('stdout') { should match(%r{default\s+healthy\s+0/0\s+[Hh]ealthy}) }
elsif version == 0 && os_family == 'redhat' && os_release.to_i == 7
its('stdout') { should match(/default\(127.0.0.1,,8080\)\s+2\s+probe\s+Healthy/) }
elsif version == 0 && os_name == 'debian' && os_release.to_i >= 11
its('stdout') { should match(%r{default\s+healthy\s+0/0\s+[Hh]ealthy}) }
elsif version == 0 && os_name == 'ubuntu' && os_release.to_f >= 20.04
its('stdout') { should match(%r{default\s+healthy\s+0/0\s+[Hh]ealthy}) }
else
its('stdout') { should match(/default\s+probe\s+[Hh]ealthy/) }
end
its('stdout') { should match(/default.+[Hh]ealthy/) }
end

describe command "varnishadm #{varnishadm_opts} param.show thread_pool_max" do
Expand Down
Loading