Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
puppet-freeradius
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Projets publics
puppet-freeradius
Commits
3119bb92
Commit
3119bb92
authored
Oct 27, 2015
by
Jonathan Gazeley
Browse files
Options
Downloads
Patches
Plain Diff
Provide a better way to manage attribute filters
parent
5ee7a74f
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
manifests/attr.pp
+23
-6
23 additions, 6 deletions
manifests/attr.pp
manifests/init.pp
+10
-0
10 additions, 0 deletions
manifests/init.pp
templates/attr.fr2.erb
+5
-0
5 additions, 0 deletions
templates/attr.fr2.erb
templates/attr.fr3.erb
+5
-0
5 additions, 0 deletions
templates/attr.fr3.erb
with
43 additions
and
6 deletions
manifests/attr.pp
+
23
−
6
View file @
3119bb92
...
@@ -2,19 +2,36 @@
...
@@ -2,19 +2,36 @@
define
freeradius::attr
(
define
freeradius::attr
(
$source
,
$source
,
$ensure
=
present
,
$ensure
=
present
,
$key
=
'User-Name'
,
)
{
)
{
$fr_package
=
$::freeradius::params::fr_package
$fr_package
=
$::freeradius::params::fr_package
$fr_service
=
$::freeradius::params::fr_service
$fr_service
=
$::freeradius::params::fr_service
$fr_basepath
=
$::freeradius::params::fr_basepath
$fr_basepath
=
$::freeradius::params::fr_basepath
$fr_group
=
$::freeradius::params::fr_group
$fr_group
=
$::freeradius::params::fr_group
$fr_modconfigpath
=
$::freeradius::params::fr_modconfigpath
$fr_modulepath
=
$::freeradius::params::fr_modulepath
file
{
"
${fr_basepath}
/attr.d/
${name}
"
:
# Decide on location for attribute filters
$location
=
$::freeradius_maj_version
?
{
2
=>
$fr_basepath
,
3
=>
$fr_modconfigpath
,
default
=>
$fr_modconfigpath
,
}
# Install the attribute filter snippet
file
{
"
${location}
/
${name}
"
:
ensure
=>
$ensure
,
ensure
=>
$ensure
,
mode
=>
'0640'
,
mode
=>
'0640'
,
owner
=>
'root'
,
owner
=>
'root'
,
group
=>
$fr_group
,
group
=>
$fr_group
,
source
=>
$source
,
source
=>
$source
,
require
=>
[
File
[
"
${fr_basepath}
/attr.d"
],
Package
[
$fr_package
],
Group
[
$fr_group
]],
require
=>
[
Package
[
$fr_package
],
Group
[
$fr_group
]],
notify
=>
Service
[
$fr_service
],
notify
=>
Service
[
$fr_service
],
}
}
# Reference all attribute snippets in one file
concat::fragment
{
"attr-
${name}
"
:
target
=>
"
${fr_modulepath}
/attr_filter"
,
content
=>
template
(
"freeradius/attr.fr
${::freeradius_maj_version}
.erb"
),
}
}
}
This diff is collapsed.
Click to expand it.
manifests/init.pp
+
10
−
0
View file @
3119bb92
...
@@ -99,6 +99,16 @@ class freeradius (
...
@@ -99,6 +99,16 @@ class freeradius (
notify
=>
Service
[
$freeradius::fr_service
],
notify
=>
Service
[
$freeradius::fr_service
],
}
}
# Set up attribute filter file
concat
{
"
${freeradius::fr_modulepath}
/attr_filter"
:
owner
=>
'root'
,
group
=>
$freeradius::fr_group
,
mode
=>
'0640'
,
require
=>
[
Package
[
$freeradius::fr_package
],
Group
[
$freeradius::fr_group
]],
notify
=>
Service
[
$freeradius::fr_service
],
}
# Install a slightly tweaked stock dictionary that includes
# Install a slightly tweaked stock dictionary that includes
# our custom dictionaries
# our custom dictionaries
concat
{
"
${freeradius::fr_basepath}
/dictionary"
:
concat
{
"
${freeradius::fr_basepath}
/dictionary"
:
...
...
This diff is collapsed.
Click to expand it.
templates/attr.fr2.erb
0 → 100644
+
5
−
0
View file @
3119bb92
attr_filter filter.
<%=
@name
%>
{
key = %{
<%=
@key
%>
}
attrsfile = ${confdir}/attr.d/
<%=
@name
%>
}
This diff is collapsed.
Click to expand it.
templates/attr.fr3.erb
0 → 100644
+
5
−
0
View file @
3119bb92
attr_filter attr_filter.
<%=
@name
%>
{
key = "%{
<%=
@key
%>
}"
filename = ${modconfdir}/${.:name}/
<%=
@name
%>
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment