From 9d37d6c8dd9e654e975573643bfc9c178e1eae26 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Mon, 28 Jul 2014 11:10:45 +0800 Subject: [PATCH] add support for Debian Linux distribution --- memcached/init.sls | 4 ++++ memcached/map.jinja | 12 ++++++++++++ memcached/python_memcached.sls | 2 ++ 3 files changed, 18 insertions(+) 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