Commit 1ada5b7b authored by Jonathan's avatar Jonathan Committed by GitHub
Browse files

Merge pull request #75 from amateo/feature/add_params

Add parameters to freeradius class
parents 19967729 c72073bf
...@@ -15,6 +15,8 @@ class freeradius ( ...@@ -15,6 +15,8 @@ class freeradius (
$log_auth = 'no', $log_auth = 'no',
$preserve_mods = true, $preserve_mods = true,
$correct_escapes = true, $correct_escapes = true,
$manage_logpath = true,
$radacctdir = $freeradius::params::radacctdir,
) inherits freeradius::params { ) inherits freeradius::params {
validate_re($freeradius::fr_version, '^3', 'This module is only compatible with FreeRADIUS 3') validate_re($freeradius::fr_version, '^3', 'This module is only compatible with FreeRADIUS 3')
...@@ -276,20 +278,22 @@ class freeradius ( ...@@ -276,20 +278,22 @@ class freeradius (
} }
} }
# Make the radius log dir traversable if $manage_logpath {
file { [ # Make the radius log dir traversable
$freeradius::fr_logpath, file { [
"${freeradius::fr_logpath}/radacct", $freeradius::fr_logpath,
]: "${freeradius::fr_logpath}/radacct",
mode => '0750', ]:
require => Package[$freeradius::fr_package], mode => '0750',
} require => Package[$freeradius::fr_package],
}
file { "${freeradius::fr_logpath}/radius.log": file { "${freeradius::fr_logpath}/radius.log":
owner => $freeradius::fr_user, owner => $freeradius::fr_user,
group => $freeradius::fr_group, group => $freeradius::fr_group,
seltype => 'radiusd_log_t', seltype => 'radiusd_log_t',
require => [Package[$freeradius::fr_package], User[$freeradius::fr_user], Group[$freeradius::fr_group]], require => [Package[$freeradius::fr_package], User[$freeradius::fr_user], Group[$freeradius::fr_group]],
}
} }
logrotate::rule { 'radacct': logrotate::rule { 'radacct':
......
...@@ -143,4 +143,6 @@ class freeradius::params { ...@@ -143,4 +143,6 @@ class freeradius::params {
'Debian' => "\${raddbdir}", 'Debian' => "\${raddbdir}",
default => "\${localstatedir}/lib/radiusd", default => "\${localstatedir}/lib/radiusd",
} }
$radacctdir = "\${logdir}/radacct"
} }
...@@ -57,7 +57,7 @@ localstatedir = /var ...@@ -57,7 +57,7 @@ localstatedir = /var
sbindir = /usr/sbin sbindir = /usr/sbin
logdir = <%= @fr_logpath %> logdir = <%= @fr_logpath %>
raddbdir = <%= @fr_raddbdir %> raddbdir = <%= @fr_raddbdir %>
radacctdir = ${logdir}/radacct radacctdir = <%= @radacctdir %>
# #
# name of the running server. See also the "-n" command-line option. # name of the running server. See also the "-n" command-line option.
......
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