Created
December 16, 2015 19:39
-
-
Save kevinquinnyo/55f1442c2895b9f7b14b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!py | |
def install(states): | |
# we're pinned to 14.04 / trusty, but building some logic for future when possible | |
oscodename = __grains__['oscodename'] | |
states['varnish-repo'] = { | |
'pkgrepo.managed': [ | |
{'humanname': 'Varnish Cache 4.0'}, | |
{'name': 'deb https://repo.varnish-cache.org/ubuntu/ {0} varnish-4.0'.format(oscodename)}, | |
{'dist': oscodename}, | |
{'file': '/etc/apt/sources.list.d/varnish-cache.list'}, | |
{'gpgcheck': 1}, | |
{'key_url': 'https://repo.varnish-cache.org/GPG-key.txt'}, | |
{'require_in': [ | |
{'pkg': 'varnish'} | |
]} | |
] | |
} | |
states['varnish'] = { | |
'pkg.installed': [ | |
{'service.running': { | |
'require': [ | |
{'pkgrepo': 'varnish-repo'}, | |
{'sls': 'cache.varnish.config'} | |
], | |
}} | |
] | |
} | |
return states | |
def run(): | |
include = [ | |
{'base': 'cache.varnish.config'} | |
] | |
states = {'include': include} | |
states = install(states) | |
return states |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment