Commit 0f0a6965 authored by Angel L. Mateo's avatar Angel L. Mateo
Browse files

Add attributes parameter to freeradius::client

This parameter is an array of attributes to assign to the defined client.
parent 0bc89073
......@@ -284,6 +284,9 @@ The UDP port that this virtual server should listen on. Leave blank if this clie
##### `firewall`
Create a firewall exception for this virtual server. If this is set to `true`, you must also supply `port` and either `ip` or `ip6`. Default: `false`.
##### `attributes`
Array of attributes to assign to this client. Default: empty.
#### `freeradius::config`
Install arbitrary config snippets from a flat file. These are installed in `/etc/raddb/conf.d`
......
......@@ -11,6 +11,7 @@ define freeradius::client (
$srcip = undef,
$firewall = false,
$ensure = present,
$attributes = [],
) {
$fr_package = $::freeradius::params::fr_package
$fr_service = $::freeradius::params::fr_service
......
......@@ -6,4 +6,15 @@ client <%= @shortname %> {
<% if @virtual_server %>virtual_server = <%= @virtual_server %><% end %>
<% if @nastype %>nas_type = <%= @nastype %><% end %>
require_message_authenticator = no
<%- if !@attributes.empty? -%>
<%- if @attributes.respond_to?('join') -%>
<%= @attributes.join("\n ") %>
<%- elsif @attributes.is_a?(Hash) -%>
<%- @attributes.sort.each do |k, v| -%>
<%= k %> = <%= v %>
<%- end -%>
<%- else -%>
<%= @attributes %>
<%- end -%>
<%- end -%>
}
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