Skip to content

Instantly share code, notes, and snippets.

@mumumu
Last active December 25, 2015 01:49
Show Gist options
  • Save mumumu/6898184 to your computer and use it in GitHub Desktop.
Save mumumu/6898184 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
from fabric.api import local, sudo, hosts, env
env.warn_only = True
env.skip_bad_hosts = True
def localup():
local('sudo apt-get update && sudo apt-get upgrade')
#
# 192.168.100.11 is a nonexistent host.
#
@hosts('192.168.100.11', 'vmhost', 'monitor')
def upgrade():
sudo('aaaaaaaaaaaaa') # unknown command
sudo('apt-get update')
sudo('apt-get upgrade')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment