Last active
August 29, 2015 14:04
-
-
Save brylor/d082e6ddb77749727ddf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from fabric.api import * | |
env.hosts = ['ubuntu@test-server-01:22'] | |
env.roledefs = {"test":["test-server-01"], | |
"production":["production-server"]} | |
@roles("test") | |
def test(): | |
env.user="ubuntu" | |
print env.hosts | |
@roles("production") | |
def production(): | |
env.user="deploy" | |
print env.hosts | |
ubuntu@test-server-01:~/RTV2/rtv2$ fab production | |
[production-server] Executing task 'production' | |
['ubuntu@test-server-01:22'] | |
Done. | |
ubuntu@test-server-01:~/RTV2/rtv2$ fab test | |
[test-server-01] Executing task 'test' | |
['ubuntu@test-server-01:22'] | |
Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment