fabric
Table of Contents
Usage
from fabric.api import run
def anonymous():
run("uname -a")
def new_user(username, admin='no', comment="No comment provided"):
print("New User (%s): %s" % (username, comment))
# multiple hosts
$ fab -H system1,system2,system3 anonymous
# explicit fabfile path (default is './fabfile.py')
$ fab -f '/path/to/my/fabfile.py' -H system1 anonymous
$ fab -f '/path/to/my/fabfile.py' -H system1 new_user:myusername
# multiple tasks
$ fab -f '/path/to/my/fabfile.py' -H system1 anonymous new_user:myusername
# passing arguments
$ fab -f '/path/to/my/fabfile.py' -H system1 new_user:username=myusername
$ fab -f '/path/to/my/fabfile.py' -H system1 new_user:username=myusername,yes
$ fab -f '/path/to/my/fabfile.py' -H system1 new_user:username=myusername,admin=yes