Skip to content

add session_file_path parameter #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,15 @@ prefer IPv4 instead.

Default value: `false`

##### `session_file_path`

Data type: `String`

By default, NetBox will store session data in the database. Alternatively, a file path can be specified here to use
local file storage instead.

Default value: ''

##### `exempt_view_permissions`

Data type: `Array`
Expand Down
6 changes: 6 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@
# When determining the primary IP address for a device, IPv6 is preferred over IPv4 by default. Set this to True to
# prefer IPv4 instead.
#
# @param session_file_path
# By default, NetBox will store session data in the database. Alternatively, a file path can be specified here to use
# local file storage instead
#
# @param exempt_view_permissions
# Exempt certain models from the enforcement of view permissions. Models listed here will be viewable by all users and
# by anonymous users. List models in the form `<app>.<model>`. Add '*' to this list to exempt all models.
Expand Down Expand Up @@ -158,6 +162,7 @@
Boolean $login_required,
Boolean $metrics_enabled,
Boolean $prefer_ipv4,
String $session_file_path,
Array $exempt_view_permissions,
String $napalm_username,
String $napalm_password,
Expand Down Expand Up @@ -216,6 +221,7 @@
'login_required' => $login_required,
'metrics_enabled' => $metrics_enabled,
'prefer_ipv4' => $prefer_ipv4,
'session_file_path' => $session_file_path,
'napalm_username' => $napalm_username,
'napalm_password' => $napalm_password,
'napalm_timeout' => $napalm_timeout,
Expand Down
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@
# When determining the primary IP address for a device, IPv6 is preferred over IPv4 by default. Set this to True to
# prefer IPv4 instead.
#
# @param session_file_path
# By default, NetBox will store session data in the database. Alternatively, a file path can be specified here to use
# local file storage instead
#
# @param exempt_view_permissions
# Exempt certain models from the enforcement of view permissions. Models listed here will be viewable by all users and
# by anonymous users. List models in the form `<app>.<model>`. Add '*' to this list to exempt all models.
Expand Down Expand Up @@ -260,6 +264,7 @@
Boolean $login_required = false,
Boolean $metrics_enabled = false,
Boolean $prefer_ipv4 = false,
String $session_file_path = '',
Array $exempt_view_permissions = [],
String $napalm_username = '',
String $napalm_password = '',
Expand Down Expand Up @@ -370,6 +375,7 @@
login_required => $login_required,
metrics_enabled => $metrics_enabled,
prefer_ipv4 => $prefer_ipv4,
session_file_path => $session_file_path,
exempt_view_permissions => $exempt_view_permissions,
napalm_username => $napalm_username,
napalm_password => $napalm_password,
Expand Down
1 change: 1 addition & 0 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
login_required: false,
metrics_enabled: false,
prefer_ipv4: false,
session_file_path: '',
exempt_view_permissions: [],
napalm_username: 'some_username',
napalm_password: 'some_secret_password',
Expand Down
5 changes: 5 additions & 0 deletions templates/configuration.py.epp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Boolean $login_required,
Boolean $metrics_enabled,
Boolean $prefer_ipv4,
String $session_file_path,
Array $exempt_view_permissions,
String $napalm_username,
String $napalm_password,
Expand Down Expand Up @@ -244,7 +245,11 @@ PREFER_IPV4 = False
# By default, NetBox will store session data in the database. Alternatively, a file path can be specified here to use
# local file storage instead. (This can be useful for enabling authentication on a standby instance with read-only
# database access.) Note that the user as which NetBox runs must have read and write permissions to this path.
<% if $session_file_path { -%>
SESSION_FILE_PATH = '<%= $session_file_path %>'
<% }else { -%>
SESSION_FILE_PATH = None
<% } -%>

# Time zone (default: UTC)
TIME_ZONE = '<%= $time_zone %>'
Expand Down