Use Squid's include mechanism
[cacert-puppet.git] / sitemodules / profiles / manifests / squid.pp
1 # Class: profiles::squid.pp
2 # =========================
3 #
4 # This class defines a Squid proxy installation that allows outgoing http and
5 # https traffic to selected destinations.
6 #
7 # Parameters
8 # ----------
9 #
10 # @param acls a list of squid ACLs for regulating outgoing traffic
11 #
12 # Examples
13 # --------
14 #
15 # @example
16 # class roles::myhost {
17 # include profiles::squid
18 # }
19 #
20 # Authors
21 # -------
22 #
23 # Jan Dittberner <jandd@cacert.org>
24 #
25 # Copyright
26 # ---------
27 #
28 # Copyright 2017 Jan Dittberner
29 class profiles::squid (
30 Optional[Array[String]] $acls = undef,
31 Optional[Array[String]] $http_access = undef,
32 ) {
33 package { 'squid':
34 ensure => latest,
35 }
36
37 service { 'squid':
38 ensure => running,
39 }
40
41 file { '/etc/squid/squid.conf.d/cacert-acls.conf':
42 ensure => file,
43 owner => 'root',
44 group => 'root',
45 mode => '0644',
46 content => epp(
47 'profiles/squid/squid.conf.epp',
48 {
49 'acls' => $acls,
50 'http_access' => $http_access
51 }
52 ),
53 require => Package['squid'],
54 notify => Service['squid'],
55 }
56 }