registered variables being dumped to local files

hi all. i run a python script on a linux server that produces a report relating to
patch levels and such. it's a fairly simple thing that was requested for audit
purposes. it's a home-grown script. it works fine, and does what it needs to do.
the report it produces is simply sent to stdout.

with the hope of producing a single report covering all of these servers, i have
created a simple playbook which is designed to run the script on all targets,
capture their report via stdout, and add the reports to a single local file via
local_action. sometimes this works, and sometimes it does not. in all cases i
can see that the report is generated (stdout for each target shows on the
ansible controller during task execution). but sometimes all output for a given
target is missing from the local logfile. here is the playbook:

in case it gets munged in email:
    https://paste.pound-python.org/show/Q8hdyPC38ADSYCX82wwV/

sorry, i pasted an older (broken) yml ...

https://paste.pound-python.org/show/QAOL5ukLVvAtqtCN8I3V/

the difference is "report.stdout" vs "report.stdout.lines" ...
this issue also happens with blockinfile.

Lets say you have 20 host, then you would have 20 task trying to write to the same file at once(or at least 5 at a time with default, because forks is default set to 5), this will seldom if at all work.

You can use assemble or the template module, personally I would use the template.

local_report.j2

This makes a lot of sense. I thought i had multiple things running into each other, and I suppose
the fact that it seemed to work sometimes threw me off somewhat.

Thanks!