Is it possible to have certain code executed only once even if a task has
multiple hosts defined (without having to invoke multiple tasks from the
command line)? For example, if I had a compile step that only needs to be
done once and then the rsyncing of the files would be executed for each
host. I tried doing something like the following but it doesn't work and
fails to recognize the hosts when rsync_files is called from within the
compile task.


def compile(*projects):
    for projects in projects:
        # compile project
    rsync_files(*projects)


@hosts("host1", "host2", "host3")
def rsync_files(projects):
    # rsync compiled files to each host
_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to