Use templating to generate runnable temporary file to execute task.