Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
puppet-freeradius
Commits
51e3591a
Commit
51e3591a
authored
Jan 15, 2016
by
Jonathan
Browse files
Merge pull request #28 from djjudas21/templates
Templates
parents
12fedc08
3eef3374
Changes
6
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
51e3591a
...
...
@@ -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
...
...
files/template.header
0 → 100644
View file @
51e3591a
# -*- text -*-
##
## templates.conf -- configurations to be used in multiple places
##
## $Id: 7b8b44e051c974c1a0a6e27a0cff50e621835df2 $
######################################################################
#
# Version 2.0 has a useful new feature called "templates".
#
# Use templates by adding a line in radiusd.conf:
#
# $INCLUDE templates.conf
#
# The goal of the templates is to have common configuration located
# in this file, and to list only the *differences* in the individual
# sections. This feature is most useful for sections like "clients"
# or "home_servers", where many may be defined, and each one has
# similar repeated configuration.
#
# Something similar to templates can be done by putting common
# configuration into separate files, and using "$INCLUDE file...",
# but this is more flexible, and simpler to understand. It's also
# cheaper for the server, because "$INCLUDE" makes a copy of the
# configuration for inclusion, and templates are simply referenced.
#
# The templates are defined in the "templates" section, so that they
# do not affect the rest of the server configuration.
#
# A section can reference a template by using "$template name"
#
templates {
manifests/init.pp
View file @
51e3591a
...
...
@@ -90,6 +90,26 @@ class freeradius (
order
=>
'99'
,
}
# Set up concat template file
concat
{
"
${freeradius::fr_basepath}
/templates.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}
/templates.conf"
,
source
=>
'puppet:///modules/freeradius/template.header'
,
order
=>
'05'
,
}
concat::fragment
{
'template_footer'
:
target
=>
"
${freeradius::fr_basepath}
/templates.conf"
,
content
=>
"}
\n
"
,
order
=>
'95'
,
}
# Set up concat proxy file
concat
{
"
${freeradius::fr_basepath}
/proxy.conf"
:
owner
=>
'root'
,
...
...
manifests/template.pp
0 → 100644
View file @
51e3591a
# Configure a template snippet
define
freeradius::template
(
$source
=
undef
,
$content
=
undef
,
)
{
$fr_basepath
=
$::freeradius::params::fr_basepath
# Configure config fragment for this template
concat::fragment
{
"template -
${name}
"
:
target
=>
"
${fr_basepath}
/templates.conf"
,
source
=>
$source
,
content
=>
$content
,
order
=>
10
,
}
}
templates/radiusd.conf.fr2.erb
View file @
51e3591a
...
...
@@ -828,6 +828,14 @@ instantiate {
$INCLUDE instantiate/
}
######################################################################
#
# Enable support for templates
#
######################################################################
$INCLUDE templates.conf
######################################################################
#
# Policies that can be applied in multiple places are listed
...
...
templates/radiusd.conf.fr3.erb
View file @
51e3591a
...
...
@@ -722,6 +722,12 @@ instantiate {
#}
}
######################################################################
#
# Enable support for templates
#
$INCLUDE templates.conf
######################################################################
#
# Policies are virtual modules, similar to those defined in the
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment