Skip to content

Instantly share code, notes, and snippets.

@bitprophet
Created December 18, 2009 22:53
Show Gist options
  • Save bitprophet/259826 to your computer and use it in GitHub Desktop.
Save bitprophet/259826 to your computer and use it in GitHub Desktop.
enum = 'http://readyroom/catalog/enumerate/'
def get_hosts(which=None):
qs = ''
if which:
qs = '?which=%s' % which
ret = urllib.urlopen(enum + 'systems/' + qs).read()
return ret.split()
env.roledefs.update({
'all': lambda: get_hosts(),
'all_no_macs': lambda: filter(lambda x: 'bender' not in x and 'meeting' not in x, get_hosts()),
'vms': lambda: get_hosts('vms'),
'clients': lambda: get_hosts('clients'),
'internals': lambda: get_hosts('internals')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment