Puppet Class: osg::squid

Defined in:
manifests/squid.pp

Summary

Manage OSG squid

Overview

Parameters:

  • customize_template (String) (defaults to: 'osg/squid/customize.sh.erb')

    Path to template used to customize squid

  • net_local (Array) (defaults to: ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16'])

    Local networks

  • monitor_addresses (Array) (defaults to: ['128.142.0.0/16', '188.184.128.0/17', '188.185.128.0/17'])

    Monitor addresses

  • allow_major_cvmfs (Boolean) (defaults to: true)

    Enables and allows MAJOR_CVMFS

  • max_filedescriptors (Integer) (defaults to: 0)

    Sets max_filedescriptors

  • manage_firewall (Boolean) (defaults to: true)

    Manage firewall resources

  • squid_firewall_ensure (Enum['present', 'absent']) (defaults to: 'present')

    Ensure property for squid firewall

  • monitoring_firewall_ensure (Enum['present', 'absent']) (defaults to: 'present')

    Ensure property for monitoring firewall

  • private_interface (Optional[String]) (defaults to: undef)

    Private interface, used by firewall rules to allow squid access

  • public_interface (Optional[String]) (defaults to: undef)

    Public interface, used by firewall rules to allow monitor addresses



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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'manifests/squid.pp', line 24

class osg::squid (
  String $customize_template = 'osg/squid/customize.sh.erb',
  Array $net_local = ['10.0.0.0/8', '172.16.0.0/12', '192.168.0.0/16'],
  Array $monitor_addresses = ['128.142.0.0/16', '188.184.128.0/17', '188.185.128.0/17'],
  Boolean $allow_major_cvmfs = true,
  Integer $max_filedescriptors = 0,
  Boolean $manage_firewall = true,
  Enum['present', 'absent'] $squid_firewall_ensure = 'present',
  Enum['present', 'absent'] $monitoring_firewall_ensure = 'present',
  Optional[String] $private_interface = undef,
  Optional[String] $public_interface = undef,
) {

  include osg

  $squid_location = pick($osg::squid_location, $::fqdn)

  if $manage_firewall {
    firewall { '100 allow squid access':
      ensure  => $squid_firewall_ensure,
      dport   => '3128',
      proto   => 'tcp',
      iniface => $private_interface,
      action  => 'accept',
    }
    $monitor_addresses.each |$monitor_address| {
      firewall { "101 allow squid monitoring from ${monitor_address}":
        ensure  => $monitoring_firewall_ensure,
        dport   => '3401',
        proto   => 'udp',
        source  => $monitor_address,
        iniface => $public_interface,
        action  => 'accept',
      }
    }
  }

  package { 'frontier-squid':
    ensure  => 'present',
    require => Yumrepo['osg'],
    before  => File['/etc/squid/customize.sh'],
  }

  file { '/etc/squid/customize.sh':
    ensure  => 'file',
    owner   => 'squid',
    group   => 'squid',
    mode    => '0755',
    content => template($customize_template),
  }

  service { 'frontier-squid':
    ensure     => 'running',
    enable     => true,
    hasstatus  => true,
    hasrestart => true,
    subscribe  => File['/etc/squid/customize.sh'],
  }

  if $osg::enable_exported_resources {
    @@osg_local_site_settings { 'Squid/enabled':
      value => true,
      tag   => $osg::exported_resources_export_tag,
    }

    @@osg_local_site_settings { 'Squid/location':
      value => $squid_location,
      tag   => $osg::exported_resources_export_tag,
    }
  }

}