Hello - I spend a fair bit of time researching and the answer eludes me. Hoping that it is a simple mis-conception of mine that someone will correct.
I currently have a custom module to make REST API calls to a bunch of devices, it uses the “local” connection plugin. The custom module creates a connection everytime it needs to make a call. I was thinking maybe I could create a custom connection plugin - where I connect one time and then use that in the custom module. Besides the performance improvement - I am looking to simplify the playbook. Right not it has connection information in every single call. So if I need to change something it is a bit of a mess - yes I parameterized the values, but adding a new connection setting means changing every single task!
So I looked at the docker connector, the uri module to try and see how it is being done. For what I can gather, poring over the code, ConnectionBase class assumes that you want to do some variant of a ssh connection with copying files and executing on a remote server.
I am thinking of simply creating a dumb connector that does nothing but store the connections details I can use from my custom module. But then I cannot figure out how the module can query the connector being used for the necessary information.
Appreciate any help. Maybe my research was not sufficient - in which case please provide a link that I can read up or direct me to the source code that can help clarify my thinking.
Many thanks!
Ayya