diff --git a/README.md b/README.md index f9a7004483ed6c483a3ab61c18ab290f8f484430..d4b4e06b7133c586cc6bef523cecef23928863e2 100644 --- a/README.md +++ b/README.md @@ -45,12 +45,21 @@ of the global settings to increase flexibility. Patches are welcome. * `control_socket` Enable the control-socket virtual server. See also the "radmin" program. Default: `false` * `max_requests` The maximum number of requests which the server keeps track of. This should be 256 multiplied by the number of clients. Default: `4096` * `max_servers` Limit on the total number of servers running. Default: `4096` + * `mysql_support` Install support for MySQL. Default: `false` + * `perl_support` Install support for Perl. Default: `false` + * `utils_support` Install FreeRADIUS utils. Default: `false` + * `ldap_support` Install support for LDAP. Default: `false` + * `wpa_supplicant`. Install wpa_supplicant utility. Default: `false` ```puppet class { 'freeradius': control_socket => true, max_requests => 4096, max_servers => 4096, + mysql_support => true, + perl_support => true, + utils_support => true, + wpa_supplicant => true, } ``` diff --git a/manifests/init.pp b/manifests/init.pp index fbb56135828924a5e6ff6c692edee5414b05da99..7b917ae34189bf9b59337f501a770fe558b28163 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -3,6 +3,11 @@ class freeradius ( $control_socket = false, $max_servers = '4096', $max_requests = '4096', + $mysql_support = false, + $perl_support = false, + $utils_support = false, + $ldap_support = false, + $wpa_supplicant = false, ) inherits freeradius::params { include samba @@ -75,22 +80,36 @@ class freeradius ( order => 90, } - # Install FreeRADIUS packages from ResNet repo, which is newer than stock CentOS + # Install FreeRADIUS packages package { 'freeradius': ensure => installed, name => $fr_package, } - - package { [ - 'freeradius-mysql', - 'freeradius-perl', - 'freeradius-utils', - ]: - ensure => installed, + if $mysql_support { + package { 'freeradius-mysql': + ensure => installed, + } } - - package { 'wpa_supplicant': - ensure => installed, + if $perl_support { + package { 'freeradius-perl': + ensure => installed, + } + } + if $utils_support { + package { 'freeradius-utils': + ensure => installed, + } + } + if $ldap_support { + package { 'freeradius-ldap': + ensure => installed, + } + } + if $wpa_supplicant { + package { 'wpa_supplicant': + ensure => installed, + name => $fr_wpa_supplicant, + } } # radiusd always tests its config before restarting the service, to avoid outage. If the config is not valid, the service diff --git a/manifests/params.pp b/manifests/params.pp index 1ed1bdaa284d178472b91e5a3a840dd36e14114c..f6eb7ee33041d2a61d15324cb5d1a976de112897 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -8,6 +8,13 @@ class freeradius::params { default => 'freeradius', } + # Name of wpa_supplicant package + $fr_wpa_supplicant = $::osfamily ? { + 'RedHat' => 'wpa_supplicant', + 'Debian' => 'wpasupplicant', + default => 'wpa_supplicant', + } + # Name of FreeRADIUS service $fr_service = $::osfamily ? { 'RedHat' => 'radiusd',