generate template once for group of hosts

My understanding is that ansible normally generates a file from a template once per host. Is it possible, when I know in advance that a file will be identical for all hosts in a group, to generate it only once?

Thanks,
tomr

You can do the following (use two tasks instead of one ‘template’):

  1. Generate the template on the controller host (with delegate_to: localhost and run_once: true)
  2. Copy the generated template to all the other hosts

kind regards
Pshem