feat(compute01): Deploy a copy of netbox
Some checks failed
Build all the nodes / netaccess01 (push) Successful in 20s
Build all the nodes / ap01 (push) Successful in 31s
Build all the nodes / netcore01 (push) Successful in 19s
Build the shell / build-shell (push) Has been cancelled
Run pre-commit on all files / pre-commit (push) Has been cancelled
Build all the nodes / netcore02 (push) Successful in 37s
Build all the nodes / tower01 (push) Has been cancelled
Build all the nodes / vault01 (push) Has been cancelled
Build all the nodes / web01 (push) Has been cancelled
Build all the nodes / web02 (push) Has been cancelled
Build all the nodes / build01 (push) Successful in 1m44s
Build all the nodes / geo01 (push) Successful in 1m44s
Build all the nodes / bridge01 (push) Successful in 1m48s
Build all the nodes / hypervisor02 (push) Successful in 1m46s
Build all the nodes / hypervisor03 (push) Successful in 1m50s
Build all the nodes / geo02 (push) Successful in 1m57s
Build all the nodes / storage01 (push) Successful in 1m43s
Build all the nodes / hypervisor01 (push) Successful in 2m8s
Build all the nodes / web03 (push) Successful in 1m54s
Build all the nodes / rescue01 (push) Successful in 2m18s
Build all the nodes / compute01 (push) Successful in 2m55s
Some checks failed
Build all the nodes / netaccess01 (push) Successful in 20s
Build all the nodes / ap01 (push) Successful in 31s
Build all the nodes / netcore01 (push) Successful in 19s
Build the shell / build-shell (push) Has been cancelled
Run pre-commit on all files / pre-commit (push) Has been cancelled
Build all the nodes / netcore02 (push) Successful in 37s
Build all the nodes / tower01 (push) Has been cancelled
Build all the nodes / vault01 (push) Has been cancelled
Build all the nodes / web01 (push) Has been cancelled
Build all the nodes / web02 (push) Has been cancelled
Build all the nodes / build01 (push) Successful in 1m44s
Build all the nodes / geo01 (push) Successful in 1m44s
Build all the nodes / bridge01 (push) Successful in 1m48s
Build all the nodes / hypervisor02 (push) Successful in 1m46s
Build all the nodes / hypervisor03 (push) Successful in 1m50s
Build all the nodes / geo02 (push) Successful in 1m57s
Build all the nodes / storage01 (push) Successful in 1m43s
Build all the nodes / hypervisor01 (push) Successful in 2m8s
Build all the nodes / web03 (push) Successful in 1m54s
Build all the nodes / rescue01 (push) Successful in 2m18s
Build all the nodes / compute01 (push) Successful in 2m55s
This commit is contained in:
parent
b0ee48c21a
commit
20334be668
5 changed files with 80 additions and 1 deletions
|
@ -25,6 +25,7 @@ lib.extra.mkConfig {
|
|||
"kanidm"
|
||||
"librenms"
|
||||
"mastodon"
|
||||
# "netbox"
|
||||
"nextcloud"
|
||||
"ollama-proxy"
|
||||
"outline"
|
||||
|
|
|
@ -144,7 +144,10 @@ in
|
|||
displayName = "Netbox [Inventory]";
|
||||
enableLegacyCrypto = true;
|
||||
originLanding = "https://netbox.dgnum.eu";
|
||||
originUrl = "https://netbox.dgnum.eu/oauth/complete/oidc/";
|
||||
originUrl = [
|
||||
"https://netbox.dgnum.eu/oauth/complete/oidc/"
|
||||
"https://netbox-v2.dgnum.eu/oauth/complete/oidc/"
|
||||
];
|
||||
preferShortUsername = true;
|
||||
|
||||
scopeMaps.grp_active = [
|
||||
|
|
74
machines/nixos/compute01/netbox.nix
Normal file
74
machines/nixos/compute01/netbox.nix
Normal file
|
@ -0,0 +1,74 @@
|
|||
# SPDX-FileCopyrightText: 2024 Maurice Debray <maurice.debray@dgnum.eu>
|
||||
#
|
||||
# SPDX-License-Identifier: EUPL-1.2
|
||||
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
nixpkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
EnvironmentFile = [ config.age.secrets."netbox-environment_file".path ];
|
||||
in
|
||||
|
||||
{
|
||||
services = {
|
||||
netbox = {
|
||||
enable = true;
|
||||
package = nixpkgs.nixos.unstable.netbox_4_1;
|
||||
secretKeyFile = "/dev/null";
|
||||
listenAddress = "127.0.0.1";
|
||||
plugins = p: [ p.netbox-qrcode ];
|
||||
settings = {
|
||||
ALLOWED_HOSTS = [ "netbox-v2.dgnum.eu" ];
|
||||
REMOTE_AUTH_BACKEND = "social_core.backends.open_id_connect.OpenIdConnectAuth";
|
||||
PLUGINS = [ "netbox_qrcode" ];
|
||||
PLUGINS_CONFIG = {
|
||||
netbox_qrcode = {
|
||||
custom_text = "DGNum. contact@dgnum.eu";
|
||||
font = "Tahoma";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = lib.mkForce ''
|
||||
from os import environ as env
|
||||
|
||||
SECRET_KEY = env["SECRET_KEY"]
|
||||
|
||||
SOCIAL_AUTH_OIDC_OIDC_ENDPOINT = env["NETBOX_OIDC_URL"]
|
||||
SOCIAL_AUTH_OIDC_KEY = env["NETBOX_OIDC_KEY"]
|
||||
SOCIAL_AUTH_OIDC_SECRET = env["NETBOX_OIDC_SECRET"]
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services = {
|
||||
netbox.serviceConfig = {
|
||||
inherit EnvironmentFile;
|
||||
|
||||
TimeoutStartSec = 600;
|
||||
};
|
||||
|
||||
netbox-housekeeping.serviceConfig = {
|
||||
inherit EnvironmentFile;
|
||||
};
|
||||
|
||||
netbox-rq.serviceConfig = {
|
||||
inherit EnvironmentFile;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.nginx.extraGroups = [ "netbox" ];
|
||||
|
||||
dgn-web.simpleProxies.netbox = {
|
||||
inherit (config.services.netbox) port;
|
||||
host = "netbox-v2.dgnum.eu";
|
||||
vhostConfig.locations."/static/".alias = "${config.services.netbox.dataDir}/static/";
|
||||
};
|
||||
|
||||
# dgn-backups.jobs.netbox.settings.paths = [ "/var/lib/netbox" ];
|
||||
# dgn-backups.postgresDatabases = [ "netbox" ];
|
||||
}
|
BIN
machines/nixos/compute01/secrets/netbox-environment_file
Normal file
BIN
machines/nixos/compute01/secrets/netbox-environment_file
Normal file
Binary file not shown.
|
@ -22,6 +22,7 @@
|
|||
"librenms-environment_file"
|
||||
"mastodon-extra_env_file"
|
||||
"mastodon-smtp-password"
|
||||
"netbox-environment_file"
|
||||
"nextcloud-adminpass_file"
|
||||
"nextcloud-s3_secret_file"
|
||||
"outline-oidc_client_secret_file"
|
||||
|
|
Loading…
Add table
Reference in a new issue