Puppet Class: varnish::install

Defined in:
manifests/install.pp

Summary

Installs Varnish

Overview

Examples:

Install Varnish

include 'varnish::install'

Make sure latest version is always installed

class { 'varnish::install':
 version => latest,
}

Parameters:

  • add_repo (Boolean) (defaults to: true)

    if repo should be added

  • manage_firewall (Boolean) (defaults to: false)

    if firewall should be managed

  • varnish_listen_port (Stdlib::Port) (defaults to: 6081)

    port that varnish should listen to

  • package_name (Optional[String]) (defaults to: undef)

    manually define package name for installation

  • varnish_enterprise (Boolean) (defaults to: false)

    If varnish enterprise packages should be installed

  • varnish_enterprise_vmods_extra (Boolean) (defaults to: false)

    if varnish enterprise extra vmods should also be installed

  • version (String) (defaults to: 'present')

    passed to puppet type ‘package’, attribute ‘ensure’



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# File 'manifests/install.pp', line 26

class varnish::install (
  Boolean $add_repo = true,
  Boolean $manage_firewall = false,
  Stdlib::Port  $varnish_listen_port = 6081,
  Optional[String]  $package_name = undef,
  Boolean $varnish_enterprise = false,
  Boolean $varnish_enterprise_vmods_extra = false,
  String  $version = 'present',
) {
  class { 'varnish::repo':
    enable  => $add_repo,
    version => $version,
    before  => Package['varnish'],
  }

  class { 'varnish::firewall':
    manage_firewall     => $manage_firewall,
    varnish_listen_port => $varnish_listen_port,
  }
  #Custom Package Name defined
  if($package_name) {
    package { 'varnish':
      ensure => $version,
      name   => $package_name,
    }
  }
  else { #let the module decide
    if($varnish_enterprise) {
      $package_ensure = 'varnish-plus'
      $package_absent = 'varnish'
      if($varnish_enterprise_vmods_extra) {
        package { 'varnish-plus-vmods-extra':
          ensure  => 'present',
          name    => 'varnish-plus-vmods-extra',
          require => Package['varnish'],
        }
      }
    }
    else {
      $package_ensure = 'varnish'
      $package_absent = 'varnish-plus'
    }
    package { 'varnish-absent':
      ensure => 'absent',
      name   => $package_absent,
      before => Package['varnish'],
    }
    package { 'varnish':
      ensure => $version,
      name   => $package_ensure,
    }
  }
}