Skip to content

add configurable REPORTS_ROOT setting #19

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
6 changes: 6 additions & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
# @param install_root
# The directory where the netbox installation is unpacked
#
# @param reports_root
# The file path to the location where custom reports will be kept.
# By default, this is the netbox/reports/ directory within the base NetBox installation path.
#
# @param allowed_hosts
# Array of valid fully-qualified domain names (FQDNs) for the NetBox server. NetBox will not permit write
# access to the server via any other hostnames. The first FQDN in the list will be treated as the preferred name.
Expand Down Expand Up @@ -138,6 +142,7 @@
String $user,
String $group,
Stdlib::Absolutepath $install_root,
Optional[Stdlib::Absolutepath] $reports_root,
Array[Stdlib::Host] $allowed_hosts,
String $database_name,
String $database_user,
Expand Down Expand Up @@ -202,6 +207,7 @@
'database_host' => $database_host,
'database_port' => $database_port,
'database_conn_max_age' => $database_conn_max_age,
'reports_root' => $reports_root,
'redis_options' => $redis_options,
'email_options' => $email_options,
'secret_key' => $secret_key,
Expand Down
6 changes: 6 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
# @param install_root
# The directory where the netbox installation is unpacked
#
# @param reports_root
# The directory where custom reports will be kept.
# By default, this is the netbox/reports/ directory within the base NetBox installation path.
#
# @param handle_database
# Should the PostgreSQL database be handled by this module.
#
Expand Down Expand Up @@ -229,6 +233,7 @@
String $version = '2.10.1',
String $download_url = 'https://github.com/netbox-community/netbox/archive/v2.10.1.tar.gz',
String $download_checksum = 'b827c520e4c82842e426a5f9ad2d914d1728a3671e304d5f25eb06392c24866c',
Optional[Stdlib::Absolutepath] $reports_root = undef,
Stdlib::Absolutepath $download_tmp_dir = '/var/tmp',
String $user = 'netbox',
String $group = 'netbox',
Expand Down Expand Up @@ -350,6 +355,7 @@
user => $user,
group => $group,
install_root => $install_root,
reports_root => $reports_root,
allowed_hosts => $allowed_hosts,
database_name => $database_name,
database_user => $database_user,
Expand Down
5 changes: 4 additions & 1 deletion templates/configuration.py.epp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Integer $database_conn_max_age,
Hash $redis_options,
Hash $email_options,
Optional[Stdlib::Absolutepath] $reports_root,
String $secret_key,
String $banner_top,
String $banner_bottom,
Expand Down Expand Up @@ -233,9 +234,11 @@ PREFER_IPV4 = True
PREFER_IPV4 = False
<% } -%>

<% unless $reports_root =~ Undef { -%>
# The file path where custom reports will be stored. A trailing slash is not needed. Note that the default value of
# this setting is derived from the installed location.
# REPORTS_ROOT = '/opt/netbox/netbox/reports'
REPORTS_ROOT = '<%= $reports_root %>'
<% } -%>

# The file path where custom scripts will be stored. A trailing slash is not needed. Note that the default value of
# this setting is derived from the installed location.
Expand Down