Need Help for REST API integration with Ansible

There is URI module present in Ansible which lets you invoke REST End Points and it works preety well.
Currently i have lot of JSON Objects and corresponding REST end points ofcourse for each.
Is it a good practice for each and every parameter inside a JSON object (which is model object for REST service) configurable via jinja template in Ansible rather than POSTing complete Payload to a base URL from a file?
I mean it can be huge parameters if we make each service payload parameter as variable in ansible.
Customer demand is : they want each and every parameter used for REST API configurable via Ansible.
I dont know is it good or bad, for me it is not good practice.

Rahul

Any experts view on this ?

You really should consider developing a plugin for this rather than twisting YAML to make it happen. Check out https://docs.ansible.com/ansible/latest/dev_guide/developing_plugins.html for writing this in Python in a way that’s callable from Ansible

Thanks Andrew , but is it good to make each and every parameter of Rest api response as configurable using Ansible , considering we have huge parameters?

It is best to use jinja template to create the bosy file and call it for scalability. This is what I do using data from mssql query.

There is URI module present in Ansible which lets you invoke REST End Points and it works preety well.
Currently i have lot of JSON Objects and corresponding REST end points ofcourse for each.
Is it a good practice for each and every parameter inside a JSON object (which is model object for REST service) configurable via jinja template in Ansible rather than POSTing complete Payload to a base URL from a file?

Take a look at modules in Kubernetes space for handling module parameters.

I mean it can be huge parameters if we make each service payload parameter as variable in ansible.
Customer demand is : they want each and every parameter used for REST API configurable via Ansible.

You may want to write plugin for this. Take a look at httpapi plugin for such requirement - https://github.com/ansible/ansible/tree/devel/lib/ansible/plugins/httpapi

Thanks abhijeet .

Regards
Rahul

I think purpose of httpapi plugin is different. Here I have my own API (say built in JAX-RS or Spring Boot), and list of REST ends points are of order (10-100) where each Resource have multiple parameters to deal with.
In that context , is it good to make each param configurable using ansible?