diff --git a/memcached/init.sls b/memcached/init.sls index ad4af5b..37b0787 100644 --- a/memcached/init.sls +++ b/memcached/init.sls @@ -1,8 +1,12 @@ +{% from 'memcached/map.jinja' import memcached with context %} + memcached: pkg: - installed + - name: {{ memcached.server }} service: - running - enable: True + - name: {{ memcached.service }} - require: - pkg: memcached diff --git a/memcached/map.jinja b/memcached/map.jinja index 9dcfb93..f501da1 100644 --- a/memcached/map.jinja +++ b/memcached/map.jinja @@ -13,3 +13,15 @@ 'max_core_file_limit': False, } } %} +{% set memcached = salt['grains.filter_by']({ + 'Debian':{ + 'server': 'memcached', + 'service': 'memcached', + 'python': 'python-memcache', + }, + 'RedHat': { + 'server': 'memcached', + 'service': 'memcached', + 'python': 'python-memcached', + }, + }, merge=salt['pillar.get']('memcached:lookup')) %} diff --git a/memcached/python_memcached.sls b/memcached/python_memcached.sls index a13467a..3d12685 100644 --- a/memcached/python_memcached.sls +++ b/memcached/python_memcached.sls @@ -1,8 +1,10 @@ +{% from 'memcached/map.jinja' import memcached with context %} include: - memcached python-memcached: pkg: - installed + - name: {{ memcached.python }} - require: - pkg: memcached