dictionary.pp 990 Bytes
Newer Older
1
# Install FreeRADIUS custom dictionaries
2
3
4
define freeradius::dictionary ($source, $order = 50) {
  $fr_package  = $::freeradius::params::fr_package
  $fr_service  = $::freeradius::params::fr_service
5
  $fr_basepath = $::freeradius::params::fr_basepath
6
  $fr_group    = $::freeradius::params::fr_group
7

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

  # Reference policy.d in the global includes file
  # If no order priority is given, assume 50
  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}"],
  }
}