130 lines
3.5 KiB
Markdown
130 lines
3.5 KiB
Markdown
# NetBox Docker Image avec Plugins
|
|
|
|
Image Docker NetBox personnalisée avec plugins pré-installés, construite automatiquement via Gitea Actions.
|
|
|
|
## Plugins inclus
|
|
|
|
Par défaut, les plugins suivants sont installés :
|
|
|
|
| Plugin | Description | Activé |
|
|
|--------|-------------|--------|
|
|
| `netbox-branching` | Branching et change management (NetBox Labs) | ✅ |
|
|
| `netbox-bgp` | Gestion des sessions BGP, peers, communities | ✅ |
|
|
| `netbox-secrets` | Gestion sécurisée des secrets et mots de passe | ✅ |
|
|
| `netbox-topology-views` | Visualisation de topologie réseau | ✅ |
|
|
|
|
## Utilisation
|
|
|
|
### Pull depuis le registry
|
|
|
|
```bash
|
|
# Dernière version
|
|
docker pull gitea.arnodo.fr/damien/netbox:latest
|
|
|
|
# Version spécifique
|
|
docker pull gitea.arnodo.fr/damien/netbox:v4.2
|
|
```
|
|
|
|
### Avec Docker Compose
|
|
|
|
Créer un `docker-compose.override.yml` pour utiliser l'image personnalisée :
|
|
|
|
```yaml
|
|
services:
|
|
netbox:
|
|
image: gitea.arnodo.fr/damien/netbox:v4.2
|
|
pull_policy: always
|
|
netbox-worker:
|
|
image: gitea.arnodo.fr/damien/netbox:v4.2
|
|
pull_policy: always
|
|
netbox-housekeeping:
|
|
image: gitea.arnodo.fr/damien/netbox:v4.2
|
|
pull_policy: always
|
|
```
|
|
|
|
## Gestion des versions
|
|
|
|
La version de NetBox est définie dans le fichier `NETBOX_VERSION`. Pour changer de version :
|
|
|
|
1. Modifier le fichier `NETBOX_VERSION` avec la version souhaitée (ex: `v4.2`)
|
|
2. Commit et push
|
|
3. Le CI va automatiquement :
|
|
- Builder l'image avec cette version de NetBox
|
|
- Tagger l'image avec `latest` ET avec la version (ex: `v4.2`)
|
|
|
|
### Tags disponibles
|
|
|
|
| Tag | Description |
|
|
|-----|-------------|
|
|
| `latest` | Dernière version buildée |
|
|
| `v4.2` | Version spécifique de NetBox |
|
|
|
|
## Personnalisation des plugins
|
|
|
|
### Ajouter un plugin
|
|
|
|
1. Éditer `plugin_requirements.txt` et ajouter le package PyPI
|
|
2. Éditer `plugins.py` et ajouter le plugin à la liste `PLUGINS`
|
|
3. Configurer le plugin dans `PLUGINS_CONFIG` si nécessaire
|
|
4. Commit et push - l'image sera rebuild automatiquement
|
|
|
|
### Exemple : Activer netbox-proxbox
|
|
|
|
```python
|
|
# plugin_requirements.txt
|
|
netbox-proxbox
|
|
|
|
# plugins.py
|
|
PLUGINS = [
|
|
"netbox_branching",
|
|
"netbox_bgp",
|
|
"netbox_secrets",
|
|
"netbox_topology_views",
|
|
"netbox_proxbox", # Ajouter ici
|
|
]
|
|
|
|
PLUGINS_CONFIG = {
|
|
# ...
|
|
"netbox_proxbox": {
|
|
"proxmox": [
|
|
{
|
|
"domain": "proxmox.home.arpa",
|
|
"http_port": 8006,
|
|
"user": "netbox@pve",
|
|
"password": "your-api-token",
|
|
"ssl": True,
|
|
"node": "pve",
|
|
}
|
|
],
|
|
},
|
|
}
|
|
```
|
|
|
|
## Structure des fichiers
|
|
|
|
```
|
|
images/netbox/
|
|
├── Dockerfile # Image principale
|
|
├── NETBOX_VERSION # Version de NetBox à utiliser
|
|
├── plugin_requirements.txt # Liste des plugins PyPI
|
|
├── plugins.py # Configuration des plugins
|
|
└── README.md # Cette documentation
|
|
```
|
|
|
|
## Plugins - Liens et documentation
|
|
|
|
- **netbox-branching** : https://github.com/netboxlabs/netbox-branching
|
|
|
|
- **netbox-bgp** : https://github.com/netbox-community/netbox-bgp
|
|
|
|
- **netbox-secrets** : https://github.com/Onemind-Services-LLC/netbox-secrets
|
|
|
|
- **netbox-branching** : https://github.com/netboxlabs/netbox-branching
|
|
|
|
## Notes
|
|
|
|
- L'image utilise `uv pip` pour l'installation des plugins (méthode officielle NetBox Docker)
|
|
- Les assets statiques sont collectés au build pour les plugins qui en ont
|
|
- Compatible avec NetBox >= 4.0 (netbox-branching requiert NetBox 4.0+)
|
|
- Le fichier `NETBOX_VERSION` contrôle la version de base et le tag de l'image
|