home_server.pp 1003 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
# Configure a home_server for proxy config
define freeradius::home_server (
  $secret,
  $type = 'auth',
  $ipaddr = '',
  $ipv6addr = '',
  $virtual_server = '',
  $port = 1812,
  $proto = 'udp',
10
  $status_check = undef,
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
) {
  $fr_basepath = $::freeradius::params::fr_basepath

  # Validate multiple choice options
  unless $type in ['auth', 'acct', 'auth+acct', 'coa'] {
    fail('$type must be one of auth, acct, auth+acct, coa')
  }
  unless $proto in ['udp', 'tcp'] {
    fail('$type must be one of udp, tcp')
  }

  # Validate integers
  unless is_integer($port) {
    fail('$port must be an integer')
  }

27
28
29
30
31
32
  if $status_check {
    unless $status_check in ['none', 'status-server', 'request'] {
      fail('$status_check must be one of none, status-server, request')
    }
  }

33
34
35
36
37
38
39
40
  # Configure config fragment for this home server
  concat::fragment { "homeserver-${name}":
    target  => "${fr_basepath}/proxy.conf",
    content => template('freeradius/home_server.erb'),
    order   => 10,
  }
}