diff --git a/changelogs/fragments/influxdb_query_common_return.yml b/changelogs/fragments/influxdb_query_common_return.yml new file mode 100644 index 00000000000..92ddc2665fe --- /dev/null +++ b/changelogs/fragments/influxdb_query_common_return.yml @@ -0,0 +1,2 @@ +bugfixes: +- "influxdb_query - fixed the use of the common return 'results' caused an unexpected fault. The return is renamed to 'query_results'" diff --git a/lib/ansible/modules/database/influxdb/influxdb_query.py b/lib/ansible/modules/database/influxdb/influxdb_query.py index fb57f6fb3ca..407037849fa 100644 --- a/lib/ansible/modules/database/influxdb/influxdb_query.py +++ b/lib/ansible/modules/database/influxdb/influxdb_query.py @@ -52,11 +52,11 @@ EXAMPLES = r''' - name: Print results from the query debug: - var: connection.results + var: connection.query_results ''' RETURN = ''' -results: +query_results: description: Result from the query returned: success type: list @@ -96,7 +96,7 @@ def main(): influx = AnsibleInfluxDBRead(module) query = module.params.get('query') results = influx.read_by_query(query) - module.exit_json(changed=True, results=results) + module.exit_json(changed=True, query_results=results) if __name__ == '__main__':