Skip to content

Commit

Permalink
add support for setting a netbox token (as it's now restricted)
Browse files Browse the repository at this point in the history
  • Loading branch information
TimStallard authored and root committed Dec 5, 2022
1 parent 0ad2f27 commit 981bd17
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions icingagen/icingagen/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import click
import pynetbox

from .config import CONFIG_DIR, NETBOX_URL
from .config import CONFIG_DIR, NETBOX_URL, NETBOX_TOKEN
from .icinga import Icinga, IcingaReloadFailedException
from .logconfig import logger_setup
from .render import render
Expand All @@ -32,7 +32,7 @@ def cli(dry_run: bool, quiet: bool):
"""Generate a new Icinga configuration."""
logger_setup(quiet)

nb = pynetbox.api(NETBOX_URL)
nb = pynetbox.api(NETBOX_URL, token=NETBOX_TOKEN)
icinga = Icinga()

LOGGER.info("Building configuration from netbox")
Expand Down
1 change: 1 addition & 0 deletions icingagen/icingagen/config.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
ICINGA_PASS = "icingagenpass"
ICINGA_CA = "/var/lib/icinga2/certs/ca.crt"
NETBOX_URL = "https://netbox.example.com"
NETBOX_TOKEN = ""

0 comments on commit 981bd17

Please sign in to comment.