Skip to content

Instantly share code, notes, and snippets.

@alexaivars
Created November 1, 2011 13:27

Revisions

  1. Alexander Aivars created this gist Nov 1, 2011.
    14 changes: 14 additions & 0 deletions fabfile.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    from fabric.api import env, local, run

    def vagrant():
    # change from the default user to 'vagrant'
    env.user = 'vagrant'
    # connect to the port-forwarded ssh
    env.hosts = ['127.0.0.1:2222']

    # use vagrant ssh key
    result = local('vagrant ssh_config | grep IdentityFile', capture=True)
    env.key_filename = result.split()[1]

    def uname():
    run('uname -a')