ansible-runner icon indicating copy to clipboard operation
ansible-runner copied to clipboard

Automatic generated folders make it impossible to run different playbooks in multithreaded environment.

Open joaopfg opened this issue 2 years ago • 3 comments

The automatic generated folders (artifacts, inventory and project) make it impossible to run different playbooks (with ansible-runner) in different threads.

I can of course remove these folders before and after every command but it doesn't solve the problem when two commands are run almost at the same time.

Is there some work around for this ?

Also, I don't see the reason for these folders to be dumped into the filesystem. Couldn't they be stored as python objects and carried through the code ? Is there a deeper reason for them to be dumped into the filesystem ?

joaopfg avatar Oct 12 '22 08:10 joaopfg

Any updates on this?

urbanchef avatar Nov 17 '22 11:11 urbanchef

@urbanchef The work around I implemented in my code is to generate these folders with names in a one to one correspondence with the thread that generated them. Like this, I can manage their lifecycle in each thread. Ugly solution though. I hope someone gets inspired to make a PR getting rid of these folders. I don't have time to dig deeper into that now.

joaopfg avatar Nov 17 '22 19:11 joaopfg

FYI, I create a separate private_data_dir for each playbook run given that project_dir remains the same. I delete private_data_dir some time after. All the details I mentioned here

urbanchef avatar Nov 30 '23 09:11 urbanchef