Commit d6831973 authored by Angel L. Mateo's avatar Angel L. Mateo
Browse files

Add content parameter to freeradius::dictionary

This way you could directly use the content or a template to create the
freeradius dictionary
parent 2b9bc773
# Install FreeRADIUS custom dictionaries # Install FreeRADIUS custom dictionaries
define freeradius::dictionary ( define freeradius::dictionary (
$source, $source = undef,
$content = undef,
$order = 50, $order = 50,
$ensure = present, $ensure = present,
) { ) {
...@@ -9,6 +10,10 @@ define freeradius::dictionary ( ...@@ -9,6 +10,10 @@ define freeradius::dictionary (
$fr_basepath = $::freeradius::params::fr_basepath $fr_basepath = $::freeradius::params::fr_basepath
$fr_group = $::freeradius::params::fr_group $fr_group = $::freeradius::params::fr_group
if !$source and !$content {
fail('source or content parameter should be provided')
}
# Install dictionary in dictionary.d # Install dictionary in dictionary.d
file { "${fr_basepath}/dictionary.d/dictionary.${name}": file { "${fr_basepath}/dictionary.d/dictionary.${name}":
ensure => $ensure, ensure => $ensure,
...@@ -16,6 +21,7 @@ define freeradius::dictionary ( ...@@ -16,6 +21,7 @@ define freeradius::dictionary (
owner => 'root', owner => 'root',
group => $fr_group, group => $fr_group,
source => $source, source => $source,
content => $content,
require => [File["${fr_basepath}/dictionary.d"], Package[$fr_package], Group[$fr_group]], require => [File["${fr_basepath}/dictionary.d"], Package[$fr_package], Group[$fr_group]],
notify => Service[$fr_service], notify => Service[$fr_service],
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment