docs(netbox): add branching configuration and version compatibility matrix
All checks were successful
Build and Push Docker Images / build (push) Successful in 5s
All checks were successful
Build and Push Docker Images / build (push) Successful in 5s
This commit is contained in:
@@ -6,12 +6,12 @@ Image Docker NetBox personnalisée avec plugins pré-installés, construite auto
|
|||||||
|
|
||||||
Par défaut, les plugins suivants sont installés :
|
Par défaut, les plugins suivants sont installés :
|
||||||
|
|
||||||
| Plugin | Description | Activé |
|
| Plugin | Description | Version (pour NetBox 4.4.x) |
|
||||||
|--------|-------------|--------|
|
|--------|-------------|----------------------------|
|
||||||
| `netbox-branching` | Branching et change management (NetBox Labs) | ✅ |
|
| `netbox-branching` | Branching et change management (NetBox Labs) | 0.7.x |
|
||||||
| `netbox-bgp` | Gestion des sessions BGP, peers, communities | ✅ |
|
| `netbox-bgp` | Gestion des sessions BGP, peers, communities | 0.17.x |
|
||||||
| `netbox-secrets` | Gestion sécurisée des secrets et mots de passe | ✅ |
|
| `netbox-secrets` | Gestion sécurisée des secrets et mots de passe | latest |
|
||||||
| `netbox-topology-views` | Visualisation de topologie réseau | ✅ |
|
| `netbox-topology-views` | Visualisation de topologie réseau | latest |
|
||||||
|
|
||||||
## Utilisation
|
## Utilisation
|
||||||
|
|
||||||
@@ -22,7 +22,7 @@ Par défaut, les plugins suivants sont installés :
|
|||||||
docker pull gitea.arnodo.fr/damien/netbox:latest
|
docker pull gitea.arnodo.fr/damien/netbox:latest
|
||||||
|
|
||||||
# Version spécifique
|
# Version spécifique
|
||||||
docker pull gitea.arnodo.fr/damien/netbox:v4.2
|
docker pull gitea.arnodo.fr/damien/netbox:v4.4
|
||||||
```
|
```
|
||||||
|
|
||||||
### Avec Docker Compose
|
### Avec Docker Compose
|
||||||
@@ -32,32 +32,68 @@ Créer un `docker-compose.override.yml` pour utiliser l'image personnalisée :
|
|||||||
```yaml
|
```yaml
|
||||||
services:
|
services:
|
||||||
netbox:
|
netbox:
|
||||||
image: gitea.arnodo.fr/damien/netbox:v4.2
|
image: gitea.arnodo.fr/damien/netbox:v4.4
|
||||||
pull_policy: always
|
pull_policy: always
|
||||||
netbox-worker:
|
netbox-worker:
|
||||||
image: gitea.arnodo.fr/damien/netbox:v4.2
|
image: gitea.arnodo.fr/damien/netbox:v4.4
|
||||||
pull_policy: always
|
pull_policy: always
|
||||||
netbox-housekeeping:
|
netbox-housekeeping:
|
||||||
image: gitea.arnodo.fr/damien/netbox:v4.2
|
image: gitea.arnodo.fr/damien/netbox:v4.4
|
||||||
pull_policy: always
|
pull_policy: always
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## ⚠️ Configuration requise pour netbox-branching
|
||||||
|
|
||||||
|
Le plugin `netbox-branching` nécessite une configuration spéciale de la base de données. Tu dois modifier ta configuration NetBox pour wrapper `DATABASES` avec `DynamicSchemaDict`.
|
||||||
|
|
||||||
|
### Dans ton `configuration.py` ou via variables d'environnement :
|
||||||
|
|
||||||
|
```python
|
||||||
|
from netbox_branching.utilities import DynamicSchemaDict
|
||||||
|
|
||||||
|
DATABASES = DynamicSchemaDict({
|
||||||
|
'default': {
|
||||||
|
'ENGINE': 'django.db.backends.postgresql',
|
||||||
|
'NAME': 'netbox',
|
||||||
|
'USER': 'netbox',
|
||||||
|
'PASSWORD': 'password',
|
||||||
|
'HOST': 'postgres',
|
||||||
|
'PORT': '',
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
DATABASE_ROUTERS = [
|
||||||
|
'netbox_branching.database.BranchAwareRouter',
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Permissions PostgreSQL requises
|
||||||
|
|
||||||
|
L'utilisateur PostgreSQL doit avoir la permission de créer des schemas :
|
||||||
|
|
||||||
|
```sql
|
||||||
|
GRANT CREATE ON DATABASE netbox TO netbox;
|
||||||
|
```
|
||||||
|
|
||||||
|
Voir la [documentation officielle netbox-branching](https://netboxlabs.com/docs/extensions/branching/) pour plus de détails.
|
||||||
|
|
||||||
## Gestion des versions
|
## Gestion des versions
|
||||||
|
|
||||||
La version de NetBox est définie dans le fichier `NETBOX_VERSION`. Pour changer de version :
|
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`)
|
1. Modifier le fichier `NETBOX_VERSION` avec la version souhaitée (ex: `v4.4`)
|
||||||
2. Commit et push
|
2. **Mettre à jour les versions des plugins** dans `plugin_requirements.txt` si nécessaire
|
||||||
3. Le CI va automatiquement :
|
3. Commit et push
|
||||||
|
4. Le CI va automatiquement :
|
||||||
- Builder l'image avec cette version de NetBox
|
- Builder l'image avec cette version de NetBox
|
||||||
- Tagger l'image avec `latest` ET avec la version (ex: `v4.2`)
|
- Tagger l'image avec `latest` ET avec la version (ex: `v4.4`)
|
||||||
|
|
||||||
### Tags disponibles
|
### Compatibilité plugins / NetBox
|
||||||
|
|
||||||
| Tag | Description |
|
| NetBox | netbox-branching | netbox-bgp |
|
||||||
|-----|-------------|
|
|--------|------------------|------------|
|
||||||
| `latest` | Dernière version buildée |
|
| 4.4.x | 0.7.x | 0.17.x |
|
||||||
| `v4.2` | Version spécifique de NetBox |
|
| 4.5.x | 0.8.x+ | 0.18.x+ |
|
||||||
|
|
||||||
## Personnalisation des plugins
|
## Personnalisation des plugins
|
||||||
|
|
||||||
@@ -68,45 +104,13 @@ La version de NetBox est définie dans le fichier `NETBOX_VERSION`. Pour changer
|
|||||||
3. Configurer le plugin dans `PLUGINS_CONFIG` si nécessaire
|
3. Configurer le plugin dans `PLUGINS_CONFIG` si nécessaire
|
||||||
4. Commit et push - l'image sera rebuild automatiquement
|
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
|
## Structure des fichiers
|
||||||
|
|
||||||
```
|
```
|
||||||
images/netbox/
|
images/netbox/
|
||||||
├── Dockerfile # Image principale
|
├── Dockerfile # Image principale
|
||||||
├── NETBOX_VERSION # Version de NetBox à utiliser
|
├── NETBOX_VERSION # Version de NetBox à utiliser
|
||||||
├── plugin_requirements.txt # Liste des plugins PyPI
|
├── plugin_requirements.txt # Liste des plugins PyPI (avec versions)
|
||||||
├── plugins.py # Configuration des plugins
|
├── plugins.py # Configuration des plugins
|
||||||
└── README.md # Cette documentation
|
└── README.md # Cette documentation
|
||||||
```
|
```
|
||||||
@@ -114,16 +118,14 @@ images/netbox/
|
|||||||
## Plugins - Liens et documentation
|
## Plugins - Liens et documentation
|
||||||
|
|
||||||
- **netbox-branching** : https://github.com/netboxlabs/netbox-branching
|
- **netbox-branching** : https://github.com/netboxlabs/netbox-branching
|
||||||
|
|
||||||
- **netbox-bgp** : https://github.com/netbox-community/netbox-bgp
|
- **netbox-bgp** : https://github.com/netbox-community/netbox-bgp
|
||||||
|
|
||||||
- **netbox-secrets** : https://github.com/Onemind-Services-LLC/netbox-secrets
|
- **netbox-secrets** : https://github.com/Onemind-Services-LLC/netbox-secrets
|
||||||
|
- **netbox-topology-views** : https://github.com/netbox-community/netbox-topology-views
|
||||||
- **netbox-branching** : https://github.com/netboxlabs/netbox-branching
|
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
- L'image utilise `uv pip` pour l'installation des plugins (méthode officielle NetBox Docker)
|
- 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
|
- Les assets statiques sont collectés au premier démarrage (pas au build)
|
||||||
- Compatible avec NetBox >= 4.0 (netbox-branching requiert NetBox 4.0+)
|
- Compatible avec NetBox >= 4.0 (netbox-branching requiert NetBox 4.1+)
|
||||||
- Le fichier `NETBOX_VERSION` contrôle la version de base et le tag de l'image
|
- Le fichier `NETBOX_VERSION` contrôle la version de base et le tag de l'image
|
||||||
|
- **Les versions des plugins sont fixées** pour garantir la compatibilité
|
||||||
|
|||||||
Reference in New Issue
Block a user