diff --git a/attributes/default.rb b/attributes/default.rb index 869d543..943120a 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -116,3 +116,12 @@ default['librenms']['auth_ad']['req_member'] = 'false' default['librenms']['auth_ad']['admingroup_level'] = '10' default['librenms']['auth_ad']['usergroup_level'] = '5' + +# Radius auth +default['librenms']['auth_radius']['enabled'] = false +default['librenms']['auth_radius']['server'] = 'radius.your-domain.com' +default['librenms']['auth_radius']['port'] = '1812' +default['librenms']['auth_radius']['secret'] = 'examplesecret' +default['librenms']['auth_radius']['timeout'] = 3 +default['librenms']['auth_radius']['users_purge'] = 14 +default['librenms']['auth_radius']['default_level'] = 1 diff --git a/recipes/default.rb b/recipes/default.rb index 10d8bef..1df45fa 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -337,6 +337,13 @@ ad_req: node['librenms']['auth_ad']['req_member'], ad_admlvl: node['librenms']['auth_ad']['admingroup_level'], ad_usrlvl: node['librenms']['auth_ad']['usergroup_level'], + radius_enabled: node['librenms']['auth_radius']['enabled'], + radius_server: node['librenms']['auth_radius']['server'], + radius_port: node['librenms']['auth_radius']['port'], + radius_secret: node['librenms']['auth_radius']['secret'], + radius_timeout: node['librenms']['auth_radius']['timeout'], + radius_user_purge: node['librenms']['auth_radius']['users_purge'], + radius_default_lvl: node['librenms']['auth_radius']['default_level'], add_conf_file_path: node['librenms']['add_config_file']['path'], rrddir: node['librenms']['rrd_dir'], ) diff --git a/templates/default/config.php.erb b/templates/default/config.php.erb index cd59725..ab3e401 100644 --- a/templates/default/config.php.erb +++ b/templates/default/config.php.erb @@ -55,6 +55,14 @@ $config['active_directory']['users_purge'] = <%= @ad_purge %>; $config['auth_ad_require_groupmembership'] = <%= @ad_req %>; $config['auth_ad_groups']['']['level'] = <%= @ad_admlvl %>; $config['auth_ad_groups']['']['level'] = <%= @ad_usrlvl %>; +<% elsif @radius_enabled %> +$config['auth_mechanism'] = "radius"; +$config['radius']['hostname'] = '<%= @radius_server %>'; +$config['radius']['port'] = '<%= @radius_port%>'; +$config['radius']['secret'] = '<%= @radius_secret %>'; +$config['radius']['timeout'] = <%= @radius_timeout %>; +$config['radius']['users_purge'] = <%= @radius_user_purge %>; +$config['radius']['default_level'] = <%= @radius_default_lvl %>; <% else %> $config['auth_mechanism'] = "mysql"; # default, other options: ldap, http-auth <% end %>