-
Notifications
You must be signed in to change notification settings - Fork 34
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
Environment variable fallback for token and URL does not work #479
Comments
Thanks for the report @netgirard! Apparently that documentation was inadvertently added to all plugins as part of #345 as it is valid for the API based plugins (lookup and action) but not the modules. So, it's not a true statement, but that doesn't mean it can't be. I think we should definitely add this in for consistency. |
Thanks @joewesch, yes, I looked at the underlying argument spec and saw no hint of the fallback config. I can do a PR if that would help, just ran out of time and wanted to get the issue written down. Seems like it is a pretty quick fix, unless there is something lurking in the dark. |
I looked at it a bit yesterday, and yes the fix should be as simple as changing |
So, in short. If you would like to put in the PR to fix it, go ahead. Otherwise I can. |
Ansible has builtin handling as well, so you can keep it all in the arg spec.
I can put something together today. |
Oh, perfect. I was trying to find that in documentation but never could. |
That is just the bare code changes, it fixes my test case. Not sure if it needs any documentation changes, since it already had the proposed functionality mentioned. Or if there is anything else to update. |
ISSUE TYPE
SOFTWARE VERSIONS
pynautobot
2.4.2
Ansible:
2.17.7
Nautobot:
2.3.8
Collection:
5.5.0
SUMMARY
Nautobot module task fails with missing required arguments: token, url, even though NAUTOBOT_TOKEN and NAUTOBOT_URL are set in the environment
STEPS TO REPRODUCE
EXPECTED RESULTS
Expected the tasks to run. With a modified playbook, I get more expected behavior.
ACTUAL RESULTS
Task does not run becuase of missing required arguments, and no fallback method is coded into the argument_spec.
The text was updated successfully, but these errors were encountered: