Question on Ansible remote copy

32 views
Skip to first unread message

GC-Ansible-User

unread,
Nov 1, 2016, 6:27:57 PM11/1/16
to Ansible Project
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.


Brian Coca

unread,
Nov 1, 2016, 8:50:21 PM11/1/16
to ansible...@googlegroups.com
You can do it several ways, I recommend you fetch/slurp from host1 and then use copy to the rest.


----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages