Skip to content

Commit

Permalink
Read secret from file
Browse files Browse the repository at this point in the history
  • Loading branch information
uubk committed Oct 7, 2023
1 parent 14fbe16 commit 6598633
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions configuration/plugins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# Add your plugins and plugin settings here.
# Of course uncomment this file out.

password = "dummyvalue"
try:
with open("/run/secrets/netbox/napalm_password", "r") as file:
password = file.read().strip()
except Exception:
pass


# To learn how to build images with your required plugins
# See https://github.com/netbox-community/netbox-docker/wiki/Using-Netbox-Plugins

Expand All @@ -13,8 +21,8 @@
# }
PLUGINS_CONFIG = {
'netbox_napalm_plugin': {
'NAPALM_USERNAME': 'xxx',
'NAPALM_PASSWORD': 'yyy',
'NAPALM_USERNAME': 'napalmviewer',
'NAPALM_PASSWORD': password,
},
}

0 comments on commit 6598633

Please sign in to comment.