Defined Type: varnish::vcl

Defined in:
manifests/vcl.pp

Overview

Define a VCL from a Puppet template and load the VCL

If the VCL fails to parse, the exec will fail and Varnish will continue to run with the old config

Parameters:

  • content (Any)
  • file (Any) (defaults to: $name)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'manifests/vcl.pp', line 6

define varnish::vcl (
  $content,
  $file = $name
) {

  include ::varnish
  include ::varnish::params

  file { $file:
    content => $content,
    owner   => 'root',
    group   => 'root',
    mode    => '0644',
    require => Class['varnish::install'],
    notify  => Exec['vcl_reload'],
  }
}