-
Notifications
You must be signed in to change notification settings - Fork 253
Add custom headers to inventory request #896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sc68cal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be managed via the standard HTTP_PROXY environment variable - https://docs.ansible.com/ansible/2.4/playbooks_environment.html
|
pynetbox under the hood uses https://requests.readthedocs.io/en/latest/user/advanced/?highlight=HTTP_PROXY#proxies |
|
Basically, I don't want us to have code in our repository that deals with however you've deployed netbox in your environment. There are generally accepted practices for setting up proxies, we have a couple of users who have reported their usage of netbox behind a proxy. You should configure an HTTP(s) proxy, instead of adding code that sets a cookie and make everyone else who ever uses this code support that. |
|
Sadly found this issue trying to figure out how to use this plugin with netbox behind Cloudflare zero trust. I'm not sure how an outbound http proxy is supposed to replace the ability to add custom headers. |
|
See the linked issue 895, user was using a custom proxy solution which required a custom header to be set in order to work with their proxy setup. I don't wish for us to carry the burden of maintaining how people set up proxies between the various NetBox components (both API clients and the netbox server), since it also has been a source of bug reports where we don't really have a way of fixing it since it's unique to each user's environment. |
|
I can understand that for a complex change. But this change is literally one line (of non-documentation). Also this functionality is explicitly supported by pynetbox, and documented. The implementation does not have any specific logic for dealing with specific proxies, it's just the generic ability to add any headers the user needs. I've rebased this PR to run my own fork, and added the same functionality to the lookup module. I'd ask you to reconsider and look at what a small change this is. https://github.com/netbox-community/ansible_modules/compare/master..clinta:custom_headers |
|
OK, that is a convincing argument to me. Open a PR. I'll 👍 |
Related Issue #895
New Behavior
Contrast to Current Behavior
New
headersare appended toself.headersto be able to add own headers.Discussion: Benefits and Drawbacks
...
Changes to the Documentation
...
Proposed Release Note Entry
Add custom headers to inventory request
Double Check
develbranch.