octplane / ansible_stdout_compact_logger

Ansible Stdout Compact Logger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When running multiple ansible processes, hosts and tasks get mixed up

nkakouros opened this issue · comments

I do not really know if this is an issue with this callback plugin, but when i do sth like:

for instance in "${instances[@]}"; do
  ansible-playbook -i "$instance" playbook.yml &
done

I get tasks that should be run on one instance tagged as having been run on another. For example:

[05:33:20] twmn.holey-firefox : file | en2720-w11-buckeye -> localhost | SUCCESS | 249ms
[05:33:20] twmn.holey-firefox : template | en2720-w11-sea-turtle | SUCCESS | 1372ms

Above, the twmn.holey-firefox role runs only for the en2720-w11-buckeye instance. However the second line shows it as having been run against en2720-w11-sea-turtle.

This is just an output issue as the tasks are run correctly.

Yes, this is because this callback is generating fragments of texts with no buffering. It could be fixable if this was a reasonable use case, but I think you should also be able to fix that by wrapping the script output into something to make this better.

Fixing the plugin would require quite some work so I won't do that. sorry.