Skip to content

Commit

Permalink
Merge pull request #56 from jdabney/Add_radius
Browse files Browse the repository at this point in the history
Added ability to do radius
  • Loading branch information
inetAnt authored Jun 18, 2018
2 parents 1eeeb59 + 9444c61 commit cd2d17c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
)
Expand Down
8 changes: 8 additions & 0 deletions templates/default/config.php.erb
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ $config['active_directory']['users_purge'] = <%= @ad_purge %>;
$config['auth_ad_require_groupmembership'] = <%= @ad_req %>;
$config['auth_ad_groups']['<ad-admingroup>']['level'] = <%= @ad_admlvl %>;
$config['auth_ad_groups']['<ad-usergroup>']['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 %>
Expand Down

0 comments on commit cd2d17c

Please sign in to comment.