Skip to content

Instantly share code, notes, and snippets.

@jangeador
Created November 4, 2014 18:31
Show Gist options
  • Save jangeador/d8c5572278d9499b0d32 to your computer and use it in GitHub Desktop.
Save jangeador/d8c5572278d9499b0d32 to your computer and use it in GitHub Desktop.
A script to backup several switches at once
from fabric.api import run, env, settings
extreme_switches = {'172.31.100.21': 'RDSL-S042-DCore-1',
'172.31.100.22': 'RDSL-S042-DCore-2',
'172.31.100.41': 'GES-S042',
'172.31.100.61': 'DSDS-S042',
'172.31.100.81': 'DV-S042',
'172.31.100.101': 'SWJH-S042',
'172.31.100.121': 'EP-S042',
'172.31.100.141': 'AZD-S042',
'172.31.100.161': 'SL-S042',
}
env.hosts = list(extreme_switches.keys())
print env.hosts
env.shell = ''
env.user = 'admin_user'
env.password = 'pr1V@T3P@@ssssWWooRrd'
def upload_config():
with settings(warn_only=True):
run('upload configuration 10.1.100.1 %s.cfg vr VR-Default'
% extreme_switches[env.host],
shell=False)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment