Puppet Class: pulp::squid

Defined in:
manifests/squid.pp

Overview

The class to manage squid. This is used by pulp streamer.

Parameters:

  • port (Stdlib::Port) (defaults to: 3128)
  • streamer_host (Stdlib::Host) (defaults to: '127.0.0.1')
  • streamer_port (Stdlib::Port) (defaults to: 8751)
  • maximum_object_size (String) (defaults to: '5 GB')
  • maximum_object_size_in_memory (String) (defaults to: '100 MB')
  • cache_dir (Stdlib::Absolutepath) (defaults to: '/var/spool/squid')


3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
54
55
56
# File 'manifests/squid.pp', line 3

class pulp::squid(
  Stdlib::Port $port = 3128,
  Stdlib::Host $streamer_host = '127.0.0.1',
  Stdlib::Port $streamer_port = 8751,
  String $maximum_object_size = '5 GB',
  String $maximum_object_size_in_memory = '100 MB',
  Stdlib::Absolutepath $cache_dir = '/var/spool/squid',
) {
  class { 'squid':
    maximum_object_size_in_memory => $maximum_object_size_in_memory,
  }

  squid::acl { 'Safe_ports':
    type    => 'port',
    entries => [$port],
  }

  squid::http_port { 'pulp internal port':
    port    => $port,
    options => "accel defaultsite=${streamer_host}:${streamer_port}",
  }

  squid::http_access { 'localhost':
    action => 'allow',
  }

  squid::http_access { 'to_localhost':
    action => 'deny',
  }

  squid::http_access { 'all':
    action => 'deny',
  }

  squid::cache { 'all':
    action => 'allow',
  }

  squid::cache_dir { $cache_dir:
    type    => 'aufs',
    options => '10000 16 256',
  }

  squid::extra_config_section { 'extra settings':
    order          => '60',
    config_entries => {
      'cache_peer'          => "${streamer_host} parent ${streamer_port} 0 no-digest no-query originserver name=PulpStreamer",
      'cache_peer_access'   => 'PulpStreamer allow all',
      'range_offset_limit'  => 'none',
      'maximum_object_size' => $maximum_object_size,
      'minimum_object_size' => '0 kB',
    },
  }
}