fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] combining multiple tasks on multiple targets into a single fu


From: Chris Steel
Subject: [Fab-user] combining multiple tasks on multiple targets into a single function
Date: Mon, 11 Jul 2011 13:36:28 -0400

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]