Puppet Class: squid3

Defined in:
modules/squid3/manifests/init.pp

Overview

Parameters:

  • ensure (Any) (defaults to: present)
  • config_content (Any) (defaults to: undef)
  • config_source (Any) (defaults to: undef)


17
18
19
20
21
22
23
24
25
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
# File 'modules/squid3/manifests/init.pp', line 17

class squid3(
    $ensure  = present,
    $config_content = undef,
    $config_source  = undef,
) {
    validate_re($ensure, '^(present|absent)$')

    if os_version('debian >= stretch') {
        $squid = 'squid'
    } else {
        $squid = 'squid3'
    }
    file { "/etc/${squid}/squid.conf":
        ensure  => $ensure,
        mode    => '0444',
        owner   => 'root',
        group   => 'root',
        source  => $config_source,
        content => $config_content,
        require => Package[$squid],
    }

    logrotate::conf { 'squid3':
        ensure => $ensure,
        source => "puppet:///modules/squid3/${squid}-logrotate",
    }

    package { $squid:
        ensure => $ensure,
    }

    service { $squid:
        ensure    => ensure_service($ensure),
        require   => File["/etc/${squid}/squid.conf"],
        subscribe => File["/etc/${squid}/squid.conf"],
    }
}