-
Notifications
You must be signed in to change notification settings - Fork 19
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
Standard method of passing extra arguments to lookup plugins #15
Comments
any news on that ? |
We need ideas of what this looks like and then ideas of how to implement the best of those ideas. This really just identifies the problem. |
+1 to "arguments are always a dictionary" and deprecate old 'stringified' methods. |
Closing this as it's now resolved. We advise using loop: and explicitly using query() or lookup() to pass arguments into lookup plugins. Arguments passed this way should always be coded as key word arguments (positional arguments to lookup plugins end up as the list of terms). |
@abadger Could you please provide an example of your advice or submit one to the lookup plugin documentation? |
Hey, we don't normally see additional comments on closed bugs but luckily I saw your message on IRC. Here's an example of how to code the plugin: https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/lookup/aws_ssm.py#L142 Documentation in the lookup plugin docs would be good if someone wants to work on that.... |
@abadger Thank You! Your aws_ssm example has moved |
This is now 'implemented' via the plugin config system, all lookups should now shift to |
Proposal: Standard Method of Passing Extra Arguments to Lookup Plugins
Author: Toshio Kuratomi @abadger
Date: 2016/05/12
Motivation
Describe the reasons for this proposal.
Problems
A couple bugs lead me to find that lookup modules have a variety of ways of specifying their parameters:
Solution proposal
We need to add standard ways to specify and parse parameters to lookup plugins. We'd officially support something like the following (examples only. Exact syntax subject to change as it's thought through):
We would deprecate the former methods of specifying parameters:
I don't know if we'd continue to support the current style of arg passing that has support from the code when used via lookup() but not when used via
with_*
and that some plugins (for instance, password), are currently ignoring.Dependencies (optional)
Explain any dependencies. This section is optional but could be helpful.
Testing (optional)
Does / should this require testing, and if so, how? Describe here. This section is optional but could be helpful.
Documentation (optional)
Does / should this require documentation? If so, describe here. This section is optional but could be helpful.
Anything else?
If you'd like to add anything else beyond the above required and optional sections, you are welcome to do so.
The text was updated successfully, but these errors were encountered: