Skip to content

Instantly share code, notes, and snippets.

@kontinuity
Created September 26, 2014 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kontinuity/d6d948ad0dda16be0e30 to your computer and use it in GitHub Desktop.
Save kontinuity/d6d948ad0dda16be0e30 to your computer and use it in GitHub Desktop.
#!/usr/bin/python
from fabric.api import local, env, puts, run, require, cd, put, prefix
from fabric.decorators import parallel
def yummy():
host_list = [
(['localhost'], '/Users/username/private_key')
]
env.upg_command = 'sudo apt-get install bash'
setup_hosts(host_list)
def appy():
host_list = [
(['localhost'], '/Users/username/private_key')
]
env.upg_command = 'yum update bash'
setup_hosts(host_list)
def setup_hosts(host_list):
for hinfo in host_list:
hosts, key = hinfo
env.key_filename = key
env.hosts = hosts
@parallel
def upgrade_bash():
run(env.upg_command)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment