Created
August 23, 2014 00:37
-
-
Save anubhavsinha/5b9478c203eaf136f801 to your computer and use it in GitHub Desktop.
running different commands on different hosts.
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
from fabric.api import * | |
from fabric.context_managers import settings | |
hosts = ['10.10.6.234', '10.10.6.65'] | |
env.user = 'ubuntu' | |
env.key_filename = '/home/as/work/credentials/pipeline.pem' | |
def local_uname(): | |
local('uname -a') | |
def remote_uname(): | |
for index, host in enumerate(hosts): | |
with settings(host_string=host): | |
run('echo hello'+str(index)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment