You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have different NetBox instances for production, consolidation and development (using Docker instances).
Upon changes of NetBox data (e.g. setting the VM status to staged), the Webhook triggers a CI/CD pipeline.
Within the pipeline, I need to query the source NetBox instance for additional data. The Webhook data is not enough. However, I don't know the source NetBox instance of the Webhook (they are all behind the same IP).
Of course I could manually add additional body data in the Webhook. For example {"nb_instance": "development"} for the development instance and {"nb_instance": "production"} for the production instance of NetBox. However this approach is too static for me. Especially If I copy the database from the production to the development instance, the Webhook configuration of the production instance is restored and I need the think of a process, to change the Webhook configuration after a DB restore.
Idea would be, that there is the possibility to include environment variables in the webhook using Jinja2 templates.
In my docker-compose.override.yml (there is one for each NB instance), I can add an env var NETBOX_INSTANCE_ID, with my custom instance string.
Question is: Is this something currently works? Are there other approaches for this?
Any thoughts?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have different NetBox instances for production, consolidation and development (using Docker instances).
Upon changes of NetBox data (e.g. setting the VM status to
staged), the Webhook triggers a CI/CD pipeline.Within the pipeline, I need to query the source NetBox instance for additional data. The Webhook data is not enough. However, I don't know the source NetBox instance of the Webhook (they are all behind the same IP).
Of course I could manually add additional body data in the Webhook. For example
{"nb_instance": "development"}for the development instance and {"nb_instance": "production"} for the production instance of NetBox. However this approach is too static for me. Especially If I copy the database from the production to the development instance, the Webhook configuration of the production instance is restored and I need the think of a process, to change the Webhook configuration after a DB restore.Idea would be, that there is the possibility to include environment variables in the webhook using Jinja2 templates.
In my
docker-compose.override.yml(there is one for each NB instance), I can add an env varNETBOX_INSTANCE_ID, with my custom instance string.Question is: Is this something currently works? Are there other approaches for this?
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions