Puppet Class: squid

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

Overview

Parameters:

  • ensure (Wmflib::Ensure) (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/squid/manifests/init.pp', line 17

class squid(
    Wmflib::Ensure $ensure  = present,
    $config_content = undef,
    $config_source  = undef,
) {

    file { '/etc/squid/squid.conf':
        ensure  => $ensure,
        mode    => '0444',
        owner   => 'root',
        group   => 'root',
        source  => $config_source,
        content => $config_content,
        require => Package['squid'],
    }

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

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

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

    systemd::unit { 'squid':
        content  => init_template('squid', 'systemd_override'),
        override => true,
        restart  => true,
    }
}