Defined Type: squid::acl

Defined in:
manifests/acl.pp

Summary

Defines acl entries for a squid server.

Overview

Examples:

create an ACL ‘remote_urls’ containing two entries

squid::acl { 'remote_urls':
   type    => 'url_regex',
   entries => ['http://example.org/path',
               'http://example.com/anotherpath'],
}

Parameters:

  • type (String)

    The acltype of the acl, must be defined, e.g url_regex, urlpath_regex, port, ..

  • aclname (String) (defaults to: $title)

    The name of acl, defaults to the ‘title`.

  • entries (Array) (defaults to: [])

    An array of acl entries, multiple members results in multiple lines in squid.conf.

  • order (String) (defaults to: '05')

    Each ACL has an order ‘05` by default this can be specified if order of ACL definition matters.

  • comment (String) (defaults to: "acl fragment for ${aclname}")

See Also:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'manifests/acl.pp', line 20

define squid::acl (
  String $type,
  String $aclname = $title,
  Array  $entries = [],
  String $order   = '05',
  String $comment = "acl fragment for ${aclname}",
) {
  $type_cleaned = regsubst($type,':','','G')

  concat::fragment { "squid_acl_${aclname}":
    target  => $squid::config,
    content => template('squid/squid.conf.acl.erb'),
    order   => "10-${order}-${type_cleaned}",
  }
}