Puppet Class: freeradius::config

Defined in:
manifests/config.pp

Summary

Manage FreeRADIUS configuration.

Overview

This class manages the FreeRADIUS configuration.

For now, a concat resource for the users file is managed.

Examples:

include freeradius

Parameters:

  • users (Hash)

    A hash of concat::fragment resources which will be added to the user file. The ‘target’ is set automatically

  • config_dir (Stdlib::Absolutepath)
  • config_owner (String)
  • config_group (String)
  • config_mode (String)
  • clients (Hash)


14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'manifests/config.pp', line 14

class freeradius::config (
  Stdlib::Absolutepath $config_dir,
  String $config_owner,
  String $config_group,
  String $config_mode,
  Hash $users,
  Hash $clients,
) {

  # Parameter

  $clients_file = "${config_dir}/clients.conf"
  $users_file   = "${config_dir}/mods-config/files/authorize"

  # Manage users
  concat { $users_file:
    owner          => $config_owner,
    group          => $config_group,
    mode           => $config_mode,
    ensure_newline => true,
  }
  $users.each |$user, $params| {
    freeradius::user { $user:
      * => $params,
    }
  }

  # Manage clients
  concat { $clients_file:
    owner          => $config_owner,
    group          => $config_group,
    mode           => $config_mode,
    ensure_newline => true,
  }
  $clients.each | $client, $params| {
    freeradius::client { $client:
      * => $params,
    }
  }
}