Skip to content

Latest commit

 

History

History
822 lines (465 loc) · 18.8 KB

REFERENCE.md

File metadata and controls

822 lines (465 loc) · 18.8 KB

Reference

Table of Contents

Classes

Classes

netbox

Install, configure and run Netbox

Examples

Defaults
class { 'netbox':
  secret_key => $my_secret_variable
}
Downloading from a different repository
class { 'netbox':
  version           => 'x.y.z',
  download_url      => 'https://my.local.repo.example.com/netbox/netbox-x.y.z.tar.gz',
  download_checksum => 'abcde...',
}

Parameters

The following parameters are available in the netbox class.

version

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'

user

Data type: String

The user owning the Netbox installation files, and running the service.

Default value: 'netbox'

group

Data type: String

The group owning the Netbox installation files, and running the service.

Default value: 'netbox'

secret_key

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.

download_url

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'

download_checksum

Data type: String

The expected checksum of the downloaded tarball. This is used for verifying the integrity of the downloaded tarball.

Default value: '21743eda8f633761fd9a16c28658235e7ee9a79b15353770b4b1fe0d133a26e5'

download_checksum_type

Data type: String

The checksum type of the downloaded tarball. This is used for verifying the integrity of the downloaded tarball.

Default value: 'sha256'

download_tmp_dir

Data type: Stdlib::Absolutepath

Temporary directory for downloading the tarball.

Default value: '/var/tmp'

install_root

Data type: Stdlib::Absolutepath

The root directory of the netbox installation.

Default value: '/opt'

handle_database

Data type: Boolean

Should the PostgreSQL database be handled by this module.

Default value: true

include_napalm

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

include_django_storages

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

include_ldap

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

email_server

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'

email_timeout

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

email_port

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

email_username

Data type: String

Username with which to authenticate https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#email

Default value: ''

email_password

Data type: String

Password with which to authenticate https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#email

Default value: ''

email_from_email

Data type: String

Sender address for emails sent by NetBox https://netbox.readthedocs.io/en/stable/configuration/optional-settings/#email

Default value: ''

handle_redis

Data type: Boolean

Should the Redis installation be handled by this module. Defaults to true.

Default value: true

install_dependencies_from_filesystem

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

python_dependency_path

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'

database_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. Defaults to 'netbox'

Default value: 'netbox'

database_user

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'

database_password

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'

database_host

Data type: Stdlib::Host

Name of the PostgreSQL database host. Defaults to 'localhost'

Default value: 'localhost'

database_port

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

database_conn_max_age

Data type: Integer

Database max connection age in seconds. Defaults to 300.

Default value: 300

allowed_hosts

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']

banner_top

Data type: String

Text for top banner on the Netbox webapp Defaults to the empty string

Default value: ''

banner_bottom

Data type: String

Text for bottom banner on the Netbox webapp Defaults to the empty string

Default value: ''

banner_login

Data type: String

Text for login banner on the Netbox webapp Defaults to the empty string

Default value: ''

base_path

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: ''

admins

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: []

debug

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

login_required

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

metrics_enabled

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

enforce_global_unique

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

prefer_ipv4

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

exempt_view_permissions

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: []

napalm_username

Data type: String

Username that NetBox will uses to authenticate to devices when connecting via NAPALM.

Default value: ''

napalm_password

Data type: String

Password that NetBox will uses to authenticate to devices when connecting via NAPALM.

Default value: ''

napalm_timeout

Data type: Integer

NAPALM timeout (in seconds).

Default value: 30

netbox::config

Configures Netbox and gunicorn, and load the database schema.

Examples

include netbox::config

Parameters

The following parameters are available in the netbox::config class.

user

Data type: String

The user owning the Netbox installation files, and running the service.

group

Data type: String

The group owning the Netbox installation files, and running the service.

install_root

Data type: Stdlib::Absolutepath

The root directory of the netbox installation.

allowed_hosts

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.

database_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.

database_user

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.

database_password

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.

admins

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.

database_host

Data type: Stdlib::Host

Hostname where the PostgreSQL database resides.

database_port

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.

database_conn_max_age

Data type: Integer

Database max connection age in seconds. Defaults to 300.

redis_options

Data type: Hash

Options used against redis. Customize to fit your redis installation. Use default values if using the redis bundled with this module.

email_options

Data type: Hash

Options used for sending email.

secret_key

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.

banner_top

Data type: String

Text for top banner on the Netbox webapp

banner_bottom

Data type: String

Text for bottom banner on the Netbox webapp

banner_login

Data type: String

Text for login banner on the Netbox webapp

base_path

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/'

debug

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.

enforce_global_unique

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.

login_required

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.

metrics_enabled

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.

prefer_ipv4

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.

exempt_view_permissions

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.

napalm_username

Data type: String

Username that NetBox will uses to authenticate to devices when connecting via NAPALM.

napalm_password

Data type: String

Password that NetBox will uses to authenticate to devices when connecting via NAPALM.

napalm_timeout

Data type: Integer

NAPALM timeout (in seconds).

netbox::database

This class sets up PostgreSQL database. This is optional, you can choose to handle that yourself.

Examples

include netbox::database

Parameters

The following parameters are available in the netbox::database class.

database_name

Data type: String

Name of the PostgreSQL database.

database_user

Data type: String

Name of the PostgreSQL database user.

database_password

Data type: String

Name of the PostgreSQL database password.

netbox::install

Installs Netbox

Examples

include netbox::install

Parameters

The following parameters are available in the netbox::install class.

install_root

Data type: Stdlib::Absolutepath

The root directory of the netbox installation.

version

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.

download_url

Data type: String

Where to download the binary installation tarball from.

download_checksum

Data type: String

The expected checksum of the downloaded tarball. This is used for verifying the integrity of the downloaded tarball.

download_checksum_type

Data type: String

The checksum type of the downloaded tarball. This is used for verifying the integrity of the downloaded tarball.

download_tmp_dir

Data type: Stdlib::Absolutepath

Temporary directory for downloading the tarball.

user

Data type: String

The user owning the Netbox installation files, and running the service.

group

Data type: String

The group owning the Netbox installation files, and running the service.

install_method

Data type: Enum['tarball', 'git_clone']

Method for getting the Netbox software

Default value: 'tarball'

include_napalm

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

include_django_storages

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.

include_ldap

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.

install_dependencies_from_filesystem

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.

python_dependency_path

Data type: Stdlib::Absolutepath

Path to where pip can find packages when the variable $install_dependencies_from_filesystem is true

netbox::redis

Class that handles the installation of Redis

Examples

include netbox::redis

netbox::service

A class for running Netbox as a Systemd service

Parameters

The following parameters are available in the netbox::service class.

install_root

Data type: Stdlib::Absolutepath

The root directory of the netbox installation.

user

Data type: String

The user running the service.

group

Data type: String

The group running the service.