Classes
netbox
: Manage Netboxnetbox::config
: Configures Netbox and gunicornnetbox::database
: Sets up the PostgreSQL database for netboxnetbox::install
: Installs Netboxnetbox::redis
: Class that handles the installation of Redisnetbox::service
: Manage the Netbox and Netvox-rq Systemd services
Install, configure and run Netbox
class { 'netbox':
secret_key => $my_secret_variable
}
class { 'netbox':
version => 'x.y.z',
download_url => 'https://my.local.repo.example.com/netbox/netbox-x.y.z.tar.gz',
download_checksum => 'abcde...',
}
The following parameters are available in the netbox
class.
Data type: String
The version of Netbox. This must match the version in the tarball. This is used for managing files, directories and paths in the service.
Default value: '2.7.10'
Data type: String
The user owning the Netbox installation files, and running the service.
Default value: 'netbox'
Data type: String
The group owning the Netbox installation files, and running the service.
Default value: 'netbox'
Data type: String
A random string of letters, numbers and symbols that Netbox needs. This needs to be supplied, and should be treated as a secret. Should be at least 50 characters long.
Data type: String
Where to download the binary installation tarball from.
Default value: 'https://github.com/netbox-community/netbox/archive/v2.7.10.tar.gz'
Data type: String
The expected checksum of the downloaded tarball. This is used for verifying the integrity of the downloaded tarball.
Default value: '21743eda8f633761fd9a16c28658235e7ee9a79b15353770b4b1fe0d133a26e5'
Data type: String
The checksum type of the downloaded tarball. This is used for verifying the integrity of the downloaded tarball.
Default value: 'sha256'
Data type: Stdlib::Absolutepath
Temporary directory for downloading the tarball.
Default value: '/var/tmp'
Data type: Stdlib::Absolutepath
The root directory of the netbox installation.
Default value: '/opt'
Data type: Boolean
Should the PostgreSQL database be handled by this module.
Default value: true
Data type: Boolean
NAPALM allows NetBox to fetch live data from devices and return it to a requester via its REST API. Installation of NAPALM is optional. To enable it, set $include_napalm to true
Default value: true
Data type: Boolean
By default, NetBox will use the local filesystem to storage uploaded files. To use a remote filesystem, install the django-storages library and configure your desired backend in configuration.py.
Default value: true
Data type: Boolean
Makes sure the packages and the python modules needed for LDAP-authentication are installed and loaded. The LDAP-config itself is not handled by this Puppet module at present. Use the documentation found here: https://netbox.readthedocs.io/en/stable/installation/5-ldap/ for information about the config file.
Default value: true
Data type: String
Host name or IP address of the email server (use localhost if running locally) https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#email
Default value: 'localhost'
Data type: Integer
Amount of time to wait for a connection (seconds) https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#email
Default value: 10
Data type: Stdlib::Port
TCP port to use for the connection (default: 25) https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#email
Default value: 25
Data type: String
Username with which to authenticate https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#email
Default value: ''
Data type: String
Password with which to authenticate https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#email
Default value: ''
Data type: String
Sender address for emails sent by NetBox https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#email
Default value: ''
Data type: Boolean
Should the Redis installation be handled by this module. Defaults to true.
Default value: true
Data type: Boolean
Used if your machine can't reach the place pip would normally go to fetch dependencies as it would when running "pip install -r requirements.txt". Then you would have to fetch those dependencies beforehand and put them somewhere your machine can reach. This can be done by running (on a machine that can reach pip's normal sources) the following: pip download -r <requirements.txt> -d Remember to do this on local_requirements.txt also if you have one.
Default value: false
Data type: Stdlib::Absolutepath
Path to where pip can find packages when the variable $install_dependencies_from_filesystem is true
Default value: '/srv/python_dependencies'
Data type: String
Name of the PostgreSQL database. If handle_database is true, then this database gets created as well. If not, then it is only used by the application, and needs to exist. Defaults to 'netbox'
Default value: 'netbox'
Data type: String
Name of the PostgreSQL database user. If handle_database is true, then this database user gets created as well. If not, then it is only used by the application, and needs to exist. Defaults to 'netbox'
Default value: 'netbox'
Data type: String
Name of the PostgreSQL database password. If handle_database is true, then this database password gets created as well. If not, then it is only used by the application, and needs to exist. Defaults to 'netbox'
Default value: 'netbox'
Data type: Stdlib::Host
Name of the PostgreSQL database host. Defaults to 'localhost'
Default value: 'localhost'
Data type: Integer
PostgreSQL database port. NB! The PostgreSQL database that is made when using handle_database does not support configuring a non-standard port. So change this parameter only if using separate PostgreSQL DB with non-standard port. Defaults to 5432.
Default value: 5432
Data type: Integer
Database max connection age in seconds. Defaults to 300.
Default value: 300
Data type: Array[Stdlib::Host]
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.
Default value: ['netbox.exmple.com','localhost']
Data type: String
Text for top banner on the Netbox webapp Defaults to the empty string
Default value: ''
Data type: String
Text for bottom banner on the Netbox webapp Defaults to the empty string
Default value: ''
Data type: String
Text for login banner on the Netbox webapp Defaults to the empty string
Default value: ''
Data type: String
Base URL path if accessing NetBox within a directory. For example, if installed at http://example.com/netbox/, set: BASE_PATH = 'netbox/'
Default value: ''
Data type: Array
Array of hashes with two keys, 'name' and 'email'. This is where the email goes if something goes wrong This feature (in the Puppet module) is not well tested.
Default value: []
Data type: Boolean
Set to True to enable server debugging. WARNING: Debugging introduces a substantial performance penalty and may reveal sensitive information about your installation. Only enable debugging while performing testing. Never enable debugging on a production system.
Default value: false
Data type: Boolean
Setting this to True will permit only authenticated users to access any part of NetBox. By default, anonymous users are permitted to access most data in NetBox (excluding secrets) but not make any changes.
Default value: false
Data type: Boolean
Setting this to true will permit only authenticated users to access any part of NetBox. By default, anonymous users are permitted to access most data in NetBox (excluding secrets) but not make any changes.
Default value: false
Data type: Boolean
Enforcement of unique IP space can be toggled on a per-VRF basis. To enforce unique IP space within the global table (all prefixes and IP addresses not assigned to a VRF), set ENFORCE_GLOBAL_UNIQUE to True.
Default value: false
Data type: Boolean
When determining the primary IP address for a device, IPv6 is preferred over IPv4 by default. Set this to True to prefer IPv4 instead.
Default value: false
Data type: Array
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.
Default value: []
Data type: String
Username that NetBox will uses to authenticate to devices when connecting via NAPALM.
Default value: ''
Data type: String
Password that NetBox will uses to authenticate to devices when connecting via NAPALM.
Default value: ''
Data type: Integer
NAPALM timeout (in seconds).
Default value: 30
Configures Netbox and gunicorn, and load the database schema.
include netbox::config
The following parameters are available in the netbox::config
class.
Data type: String
The user owning the Netbox installation files, and running the service.
Data type: String
The group owning the Netbox installation files, and running the service.
Data type: Stdlib::Absolutepath
The root directory of the netbox installation.
Data type: Array[Stdlib::Host]
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.
Data type: String
Name of the PostgreSQL database. If handle_database is true, then this database gets created as well. If not, then it is only used by the application, and needs to exist.
Data type: String
Name of the PostgreSQL database user. If handle_database is true, then this database user gets created as well. If not, then it is only used by the application, and needs to exist.
Data type: String
Name of the PostgreSQL database password. If handle_database is true, then this database password gets created as well. If not, then it is only used by the application, and needs to exist.
Data type: Array
Array of hashes with two keys, 'name' and 'email'. This is where the email goes if something goes wrong This feature (in the Puppet module) is not well tested.
Data type: Stdlib::Host
Hostname where the PostgreSQL database resides.
Data type: Integer
PostgreSQL database port. NB! The PostgreSQL database that is made when using handle_database does not support configuring a non-standard port. So change this parameter only if using separate PostgreSQL DB with non-standard port. Defaults to 5432.
Data type: Integer
Database max connection age in seconds. Defaults to 300.
Data type: Hash
Options used against redis. Customize to fit your redis installation. Use default values if using the redis bundled with this module.
Data type: Hash
Options used for sending email.
Data type: String
A random string of letters, numbers and symbols that Netbox needs. This needs to be supplied, and should be treated as a secret. Should be at least 50 characters long.
Data type: String
Text for top banner on the Netbox webapp
Data type: String
Text for bottom banner on the Netbox webapp
Data type: String
Text for login banner on the Netbox webapp
Data type: String
Base URL path if accessing NetBox within a directory. For example, if installed at http://example.com/netbox/, set: BASE_PATH = 'netbox/'
Data type: Boolean
Set to True to enable server debugging. WARNING: Debugging introduces a substantial performance penalty and may reveal sensitive information about your installation. Only enable debugging while performing testing. Never enable debugging on a production system.
Data type: Boolean
Enforcement of unique IP space can be toggled on a per-VRF basis. To enforce unique IP space within the global table (all prefixes and IP addresses not assigned to a VRF), set ENFORCE_GLOBAL_UNIQUE to True.
Data type: Boolean
Setting this to True will permit only authenticated users to access any part of NetBox. By default, anonymous users are permitted to access most data in NetBox (excluding secrets) but not make any changes.
Data type: Boolean
Setting this to true will permit only authenticated users to access any part of NetBox. By default, anonymous users are permitted to access most data in NetBox (excluding secrets) but not make any changes.
Data type: Boolean
When determining the primary IP address for a device, IPv6 is preferred over IPv4 by default. Set this to True to prefer IPv4 instead.
Data type: Array
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.
Data type: String
Username that NetBox will uses to authenticate to devices when connecting via NAPALM.
Data type: String
Password that NetBox will uses to authenticate to devices when connecting via NAPALM.
Data type: Integer
NAPALM timeout (in seconds).
This class sets up PostgreSQL database. This is optional, you can choose to handle that yourself.
include netbox::database
The following parameters are available in the netbox::database
class.
Data type: String
Name of the PostgreSQL database.
Data type: String
Name of the PostgreSQL database user.
Data type: String
Name of the PostgreSQL database password.
Installs Netbox
include netbox::install
The following parameters are available in the netbox::install
class.
Data type: Stdlib::Absolutepath
The root directory of the netbox installation.
Data type: String
The version of Netbox. This must match the version in the tarball. This is used for managing files, directories and paths in the service.
Data type: String
Where to download the binary installation tarball from.
Data type: String
The expected checksum of the downloaded tarball. This is used for verifying the integrity of the downloaded tarball.
Data type: String
The checksum type of the downloaded tarball. This is used for verifying the integrity of the downloaded tarball.
Data type: Stdlib::Absolutepath
Temporary directory for downloading the tarball.
Data type: String
The user owning the Netbox installation files, and running the service.
Data type: String
The group owning the Netbox installation files, and running the service.
Data type: Enum['tarball', 'git_clone']
Method for getting the Netbox software
Default value: 'tarball'
Data type: Boolean
NAPALM allows NetBox to fetch live data from devices and return it to a requester via its REST API. Installation of NAPALM is optional. To enable it, set $include_napalm to true
Data type: Boolean
By default, NetBox will use the local filesystem to storage uploaded files. To use a remote filesystem, install the django-storages library and configure your desired backend in configuration.py.
Data type: Boolean
Makes sure the packages and the python modules needed for LDAP-authentication are installed and loaded. The LDAP-config itself is not handled by this Puppet module at present. Use the documentation found here: https://netbox.readthedocs.io/en/stable/installation/6-ldap/ for information about the config file.
Data type: Boolean
Used if your machine can't reach the place pip would normally go to fetch dependencies as it would when running "pip install -r requirements.txt". Then you would have to fetch those dependencies beforehand and put them somewhere your machine can reach. This can be done by running (on a machine that can reach pip's normal sources) the following: pip download -r <requirements.txt> -d Remember to do this on local_requirements.txt also if you have one.
Data type: Stdlib::Absolutepath
Path to where pip can find packages when the variable $install_dependencies_from_filesystem is true
Class that handles the installation of Redis
include netbox::redis
A class for running Netbox as a Systemd service
The following parameters are available in the netbox::service
class.
Data type: Stdlib::Absolutepath
The root directory of the netbox installation.
Data type: String
The user running the service.
Data type: String
The group running the service.