Skip to content

Instantly share code, notes, and snippets.

@mattbillenstein
Created September 15, 2016 23:46
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 mattbillenstein/45afd15e922143df190dcadaef2d6020 to your computer and use it in GitHub Desktop.
Save mattbillenstein/45afd15e922143df190dcadaef2d6020 to your computer and use it in GitHub Desktop.
data = salt['mine.get']('*', 'grains.items')
master = [k for k, v in pillar['roles'].iteritems() if 'mongod_master' in v][0]
mongo_ip = [_ for _ in data[master]['ipv4'] if not _.startswith('127.')][0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment