Skip to content
This repository has been archived by the owner on Jul 26, 2020. It is now read-only.

Latest commit

 

History

History
39 lines (29 loc) · 1.1 KB

fabric.org

File metadata and controls

39 lines (29 loc) · 1.1 KB

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

Reference Links