Commit b54e2fff authored by Jonathan Gazeley's avatar Jonathan Gazeley
Browse files

First attempt at supporting FreeRADIUS templates

parent 12fedc08
......@@ -26,6 +26,7 @@
* [`freeradius::site`](#freeradiussite)
* [`freeradius::sql`](#freeradiussql)
* [`freeradius::statusclient`](#freeradiusstatusclient)
* [`freeradius::template`](#freeradiustemplate)
4. [Limitations - OS compatibility, etc.](#limitations)
5. [Development - Guide for contributing to the module](#development)
6. [Release Notes](#release-notes)
......@@ -717,6 +718,17 @@ Default: `undef`. The UDP port that this virtual server should listen on. Leave
##### `shortname`
required. A short alias that is used in place of the IP address or fully qualified hostname provided in the first line of the section.
#### `freeradius::template`
Define template items that can be referred to in other config items
##### `source`
Provide source to a file with the template item. Specify only one of `source` or `content`.
##### `content`
Provide content of template item. Specify only one of `source` or `content`.
## Limitations
......
......@@ -90,6 +90,20 @@ class freeradius (
order => '99',
}
# Set up concat template file
concat { "${freeradius::fr_basepath}/template.conf":
owner => 'root',
group => $freeradius::fr_group,
mode => '0640',
require => [Package[$freeradius::fr_package], Group[$freeradius::fr_group]],
notify => Service[$freeradius::fr_service],
}
concat::fragment { 'template_header':
target => "${freeradius::fr_basepath}/template.conf",
content => "# Template config\n\n",
order => '05',
}
# Set up concat proxy file
concat { "${freeradius::fr_basepath}/proxy.conf":
owner => 'root',
......
# Configure a template snippet
define freeradius::template (
$source,
$content,
) {
$fr_basepath = $::freeradius::params::fr_basepath
# Configure config fragment for this template
concat::fragment { "template -${name}":
target => "${fr_basepath}/template.conf",
source => $source,
content => $content,
order => 10,
}
}
......@@ -828,6 +828,14 @@ instantiate {
$INCLUDE instantiate/
}
######################################################################
#
# Enable support for templates
#
######################################################################
$INCLUDE templates.conf
######################################################################
#
# Policies that can be applied in multiple places are listed
......
......@@ -722,6 +722,12 @@ instantiate {
#}
}
######################################################################
#
# Enable support for templates
#
$INCLUDE templates.conf
######################################################################
#
# Policies are virtual modules, similar to those defined in the
......
Markdown is supported
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