Loading manifests/attr.pp +19 −2 Original line number Diff line number Diff line Loading @@ -2,19 +2,36 @@ define freeradius::attr ( $source, $ensure = present, $key = 'User-Name', ) { $fr_package = $::freeradius::params::fr_package $fr_service = $::freeradius::params::fr_service $fr_basepath = $::freeradius::params::fr_basepath $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, mode => '0640', owner => 'root', group => $fr_group, 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], } # 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"), } } manifests/init.pp +10 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,16 @@ class freeradius ( 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 # our custom dictionaries concat { "${freeradius::fr_basepath}/dictionary": Loading templates/attr.fr2.erb 0 → 100644 +5 −0 Original line number Diff line number Diff line attr_filter filter.<%= @name %> { key = %{<%= @key %>} attrsfile = ${confdir}/attr.d/<%= @name %> } templates/attr.fr3.erb 0 → 100644 +5 −0 Original line number Diff line number Diff line attr_filter attr_filter.<%= @name %> { key = "%{<%= @key %>}" filename = ${modconfdir}/${.:name}/<%= @name %> } Loading
manifests/attr.pp +19 −2 Original line number Diff line number Diff line Loading @@ -2,19 +2,36 @@ define freeradius::attr ( $source, $ensure = present, $key = 'User-Name', ) { $fr_package = $::freeradius::params::fr_package $fr_service = $::freeradius::params::fr_service $fr_basepath = $::freeradius::params::fr_basepath $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, mode => '0640', owner => 'root', group => $fr_group, 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], } # 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"), } }
manifests/init.pp +10 −0 Original line number Diff line number Diff line Loading @@ -99,6 +99,16 @@ class freeradius ( 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 # our custom dictionaries concat { "${freeradius::fr_basepath}/dictionary": Loading
templates/attr.fr2.erb 0 → 100644 +5 −0 Original line number Diff line number Diff line attr_filter filter.<%= @name %> { key = %{<%= @key %>} attrsfile = ${confdir}/attr.d/<%= @name %> }
templates/attr.fr3.erb 0 → 100644 +5 −0 Original line number Diff line number Diff line attr_filter attr_filter.<%= @name %> { key = "%{<%= @key %>}" filename = ${modconfdir}/${.:name}/<%= @name %> }