Closed shantanoo-desai closed 3 months ago
Yes, you're right. This functionality is missing. Do you want to create a PR to tackle this?
@rndmh3ro Yes, will work on it. AFAIK this requires only changes in the module_utils/base.py
argument_spec
, right? Because most of the plugins will then rely on the utility to interact with the API. Or am I wrong and I need to check the lookup
plugins directory and apply the changes there?
AFAIK this requires only changes in the module_utils/base.py argument_spec, right?
The argument_spec is not used in the lookup-plugin, so this will probably not work.
Or am I wrong and I need to check the lookup plugins directory and apply the changes there?
I think so, at least that's what I did some time ago in another collection.
@rrey do you have some more info here?
@rndmh3ro no problem. Let me try working on the patch and will keep the communication open via this Issue. I will try referring to another lookup
plugins from other community collections to get a better Idea.
@rndmh3ro and @rrey Sorry it took me a while to revert back to this Issue. From what I understand:
Current the GrafanaAPI
in the lookup plugin code does not take in any additional parameters apart from the string term
based on the standard URL lookup plugin, it shouldn't be that difficult to obtain any additional terms from the lookup text (assuming using the self.get_option('validate_certs')
and pass the value to the GrafanaAPI
. However I am not sure if we need to refactor the GrafanaAPI
class
Please advise on this topic to comply with submitting a fix for this Issue
I think adding the missing options to the GrafanaAPI
class should be sufficient.
SUMMARY
As a simple example, I have a Grafana Container running behind a reverse-proxy with Self-Signed Certificates which I do not want to have validated. The Grafana instance is reachable via
https://<remote_machine>/grafana
APIUpon using the following task:
ISSUE TYPE
COMPONENT NAME
community.grafana.grafana_dashboard
lookup pluginANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Windows Subsystem For Linux 2 - Ubuntu 20.04 LTS
STEPS TO REPRODUCE
EXPECTED RESULTS
Additional
validate_certs
variable should be accepted to bypass SSL certificate validation, the value is eithertrue
orfalse
An expectation is that the lookup plugin might behave similarly to the URL lookup plugin where explicit headers and
validate_certs
parameters can be explicitly set.ACTUAL RESULTS
Throws a SSL certificate verification error: