Is it possible to put a client object somewhere so it can be shared/reused by custom plugins ? That is, only for tasks running on the controlling node.
I’m trying to reuse the very same pysnow client object in successive tasks. Hoping to improve the performance of a very long running playbook.
No collections. Just the classic *_plugins directories. For example action_plugins.
The code is available to the controlling node too. What I’m trying to achieve is to create once the pysnow client, put it ‘somewhere’ and have the action plugins access this very same object. However, what is that ‘somewhere’, if any.
Unfortunately, every task runs in a different process (the pid is different) but they all share the same parent process. So, maybe, there is a way. I guess this is what Ansible does when it reuses the ssh connection.
Is it possible to put a client object somewhere so it can be
shared/reused by custom plugins ? That is, only for tasks running on
the controlling node.
I'm trying to reuse the very same pysnow client object in successive
tasks. Hoping to improve the performance of a very long running
playbook.
for modules there exists some framework in cloud.common
(https://galaxy.ansible.com/cloud/common) called 'Ansible turbo module'
providing something like that (disclaimer: I've never used it). Not
sure whether that also works for plugins though...
So, if I’m getting this right, the idea is that the custom plugin code connects with a daemon process. And that daemon maintains the connection and other stateful data ?