from fabric.api import *

def rsync(args):
    return 'rsync --exclude=repodata -av %s' % args

def sync_local_down():
    local(rsync('dl.rockstack.org:build/epel/6/ rpm/build/epel/6/'))

def sync_local():
    local(rsync('rpm/build/epel/6/ dl.rockstack.org:build/epel/6/'))

def sync_repo(name):
    root = '/srv/dl.rockstack.org/rpm/%s/el/6' % name

    sudo(rsync('build/epel/6/ %s' % root))

    for arch in ('SRPMS', 'i386', 'x86_64'):
        with cd('%s/%s' % (root, arch)):
            sudo('createrepo --update .')

def sync_testing():
    sync_repo('testing')

def sync_stable():
    sync_repo('stable')

@@ -19,16 +19,59 @@
 port *%0A%0A
+env.roledefs%5B'dl'%5D = %5B'dl.rockstack.org'%5D%0A%0A
 def rsyn
@@ -172,32 +172,18 @@
 (rsync('
-dl.rockstack.org
+%25s
 :build/e
@@ -199,32 +199,56 @@
 m/build/epel/6/'
+ %25 env.roledefs%5B'dl'%5D%5B0%5D
 ))%0A%0Adef sync_loc
@@ -292,39 +292,46 @@
 /6/ 
-dl.rockstack.org:build/epel/6/'
+%25s:build/epel/6/' %25 env.roledefs%5B'dl'%5D
 ))%0A%0A
@@ -575,24 +575,37 @@
 update .')%0A%0A
+@roles('dl')%0A
 def sync_tes
@@ -638,16 +638,29 @@
 ting')%0A%0A
+@roles('dl')%0A
 def sync

Add host to fabfile