dictionary.pp 1.06 KB
Newer Older
1
# Install FreeRADIUS custom dictionaries
2
3
4
5
6
define freeradius::dictionary (
  $source,
  $order = 50,
  $ensure = present,
) {
7
8
  $fr_package  = $::freeradius::params::fr_package
  $fr_service  = $::freeradius::params::fr_service
9
  $fr_basepath = $::freeradius::params::fr_basepath
10
  $fr_group    = $::freeradius::params::fr_group
11

12
  # Install dictionary in dictionary.d
13
  file { "${fr_basepath}/dictionary.d/dictionary.${name}":
14
    ensure  => $ensure,
15
16
    mode    => '0644',
    owner   => 'root',
17
    group   => $fr_group,
18
    source  => $source,
19
    require => [File["${fr_basepath}/dictionary.d"], Package[$fr_package], Group[$fr_group]],
20
21
22
23
24
    notify  => Service[$fr_service],
  }

  # Reference policy.d in the global includes file
  # If no order priority is given, assume 50
25
26
27
28
29
30
31
32

  if ($ensure == 'present') {
    concat::fragment { "dictionary.${name}":
      target  => "${fr_basepath}/dictionary",
      content => "\$INCLUDE ${fr_basepath}/dictionary.d/dictionary.${name}\n",
      order   => $order,
      require => File["${fr_basepath}/dictionary.d/dictionary.${name}"],
    }
33
34
  }
}