Skip to content

Instantly share code, notes, and snippets.

@rca
Last active December 12, 2015 09:39
Show Gist options
  • Save rca/4753083 to your computer and use it in GitHub Desktop.
Save rca/4753083 to your computer and use it in GitHub Desktop.
A python-based pillar `sls` file that uses grains data to create a `Network` object. The network object is returned in a dictionary that is included in the render context.
addr={{ pillar['shoe']['network'].addr }}
#!py
from somewhere import Network
def run():
# the grains variable is available inside the run() function.
return {
'shoe': {
'mirror': 'http://apt:3142/archive.ubuntu.com/ubuntu',
'network': Network(grains['nodename']),
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment