Save a variable to a File

How do I save a variable to a file if it contained contents of a file on a host that couldn’t support anything but the raw module?

It depends, but if the content in the variable isn't to big this should work.

- raw: echo '{{ variable }}' >/path/to/file