Question on Ansible remote copy

Have a question regarding remote to remote copy of files.

I have a situation where I need to generate a file on one remote server. The file then has to be copied across multiple servers (the list of servers is specified in the inventory file as a group) from this remote server.

What would be the most effective way of doing this in Ansible. I am using Ansible 2.1.

[master]
host1
[clients]
host2
host3
host4

Generate a file on host1 and then copy the files to host2, host3, host4. I don’t want to hard code the host2, host3 and host4 in the Ansible task. I want that to be a list dynamically generated based on the clients group in the inventory.

You can do it several ways, I recommend you fetch/slurp from host1 and then use copy to the rest.