I want to be able to run a single fab command, for example:

    fab combined_task

so that a number of tasks take place on various target hosts with no
additional input required.

It seem no matter what I try I get prompted for a connection string when
switching target hosts. Any ideas? This is a simplified example of the
collection of fabfiles I have inherited. Perhaps I need to modify them to
make use of roles?

def dev():
    env.hosts    = ['127.0.0.1']
    env.user     = 'uname'
    env.passwrod = 'password'

def repo():
    env.hosts    = ['10.0.1.10']
    env.user     = 'uname'
    env.passwrod = 'password'

@hosts(repo)
def task1():
    run('ls -al')

@hosts(dev)
def task2():
    run('echo test > my_test'')

def combined_task():
    task1()
    task2()

-- 
Christopher Steel

Voice of Access
_______________________________________________
Fab-user mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/fab-user

Reply via email to