Files
bf-infra/docs/nas-vlan20/nautobot-image/nautobot_config.py
Christoph Emsenhuber 1578de50c3 TP15/TP16.1: kein RB5009, WG-Mesh auf CRS326; TP21: Golden-Config-Image im Repo
- RB5009 final gestrichen (User-Entscheid 2026-07-22) — Router bleibt ap1/ap2,
  Referenzen in teilprojekte.md + hw-refresh-requirements.md bereinigt.
- TP16.1 Ziel-Device von ap1 auf CRS326 Core-Switch retargeted (Doku-only,
  Scharfschalten bleibt gated bis TP21 den CRS326 abdeckt), Runbook umbenannt
  auf tp16.1-warp-mesh-native-crs326.md, cf-tunnel-mapping.md §14 + Handoff-
  Prompt mitgezogen.
- TP21: docs/nas-vlan20/nautobot-image/ neu — der Dockerfile/nautobot_config.py/
  allnet_sg8316m_driver.py, aus denen das laufende Custom-Image tatsächlich
  gebaut ist (der bisherige Verweis auf scratch/nautobot-gc-build existierte
  nirgends). Ergänzt napalm-ros + nornir-napalm + librouteros + gepinntes
  setuptools<81 (pkg_resources-Regression), Nornir-Credentials auf
  CredentialsNautobotSecrets umgestellt, Compliance/Intended-Config/SoT-Agg
  aktiviert. Backup/Intended/Compliance-Pipeline live gegen ap1 verifiziert.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-22 19:46:24 +02:00

68 lines
3.0 KiB
Python

import os
import sys
from nautobot.core.settings import * # noqa F401,F403
from nautobot.core.settings_funcs import is_truthy, parse_redis_connection
if DATABASES["default"]["ENGINE"].endswith("mysql"):
DATABASES["default"]["OPTIONS"] = {"charset": "utf8mb4"}
SECRET_KEY = os.getenv("NAUTOBOT_SECRET_KEY", "05^)=zgn3ytglmp_iv4@era^e23u3#_wtop-@yeaeazempdy^=")
INSTALLATION_METRICS_ENABLED = is_truthy(os.getenv("NAUTOBOT_INSTALLATION_METRICS_ENABLED", "True"))
# --- BF-Netzwerk additions: Golden Config + Nornir (TP21) ---
#
# Extends the stock config shipped in the base ghcr.io/nautobot/nautobot image
# (unchanged above this point) instead of replacing it, so a rollback is just
# "point the compose file's image tag back at ghcr.io/nautobot/nautobot:3.1.7".
PLUGINS = [
"nautobot_plugin_nornir",
"nautobot_golden_config",
]
PLUGINS_CONFIG = {
"nautobot_plugin_nornir": {
"nornir_settings": {
# Per-device creds via each Device's SecretsGroup (ap1/ap2 -> "RouterOS
# Nornir" group, access_type=Generic to match this class's default --
# see get_device_creds()/_get_access_type_value() in nautobot_secrets.py).
# Switched 2026-07-22 from env_vars.CredentialsEnvVars (a single global
# NAPALM_USERNAME/PASSWORD pair for the whole fleet) so future devices
# (CRS326 etc.) can carry their own credentials.
"credentials": "nautobot_plugin_nornir.plugins.credentials.nautobot_secrets.CredentialsNautobotSecrets",
"runner": {"plugin": "threaded", "options": {"num_workers": 5}},
},
# nautobot-plugin-nornir 2.0+ dropped PLUGINS_CONFIG["dispatcher_mapping"]
# (it now errors on boot if present) -- per-platform dispatcher overrides
# moved onto the Platform model itself (network_driver_mappings). The
# ALLNET sg8316m custom driver will be wired in there once credentials
# are sorted, not here.
},
"nautobot_golden_config": {
# Backup + Intended-Config + Compliance enabled 2026-07-22 (TP21 follow-up
# session) once a Jinja template + Git repo target existed. Plan/Deploy
# (device push) stay off on purpose -- this pipeline is pull/read-only
# for now, pushing config is a deliberately separate future step.
"enable_backup": True,
"enable_compliance": True,
"enable_intended": True,
"enable_sotagg": True,
"enable_plan": False,
"enable_deploy": False,
"enable_postprocessing": False,
"postprocessing_callables": [],
"postprocessing_subscribed": [],
"per_feature_bar": True,
"per_feature_width": 0.13,
"per_feature_height": 4,
"default_deploy_status": "Not Approved",
"get_custom_compliance": None,
"sot_agg_transposer": None,
},
}
NAPALM_USERNAME = os.getenv("NAUTOBOT_NAPALM_USERNAME", "")
NAPALM_PASSWORD = os.getenv("NAUTOBOT_NAPALM_PASSWORD", "")
NAPALM_TIMEOUT = int(os.getenv("NAUTOBOT_NAPALM_TIMEOUT", "30"))