?How can we prevent from 2 ansible running on the same host at the same time
we are working with facts_catch json file and sometimes have problem that 2 ansibles try write the same json
Any file based operations that affect the controller are going to be dangerous if multiple processes are trying to do them. If you know this is going to be a common pattern, where multiple playbook executions are happening simultaneously, I’d recommend a database backed fact caching mechanism, such a redis.
There is no fool proof way of ensuring that multiple ansible invocations cannot be run simultaneously.