diff --git a/FORMULA b/FORMULA index fbf06be..27c20ad 100644 --- a/FORMULA +++ b/FORMULA @@ -1,6 +1,6 @@ name: memcached -os: RedHat, Debian, Arch, Gentoo -os_family: RedHat, Debian, Arch, Gentoo +os: RedHat, Debian, Arch, Gentoo, SUSE +os_family: RedHat, Debian, Arch, Gentoo, Suse version: 201601 release: 1 minimum_version: 2015.8 diff --git a/memcached/config.sls b/memcached/config.sls index f51c490..77fddc7 100644 --- a/memcached/config.sls +++ b/memcached/config.sls @@ -17,6 +17,7 @@ memcached_user: - user: root - group: root - mode: 644 + {%- if grains['os_family'] != 'Suse' %} {% if grains['os_family'] == 'Debian' %} - source: salt://memcached/templates/memcached.conf {% elif grains['os_family'] == 'RedHat' %} @@ -26,8 +27,21 @@ memcached_user: {% elif grains['os_family'] == 'Arch' %} - source: salt://memcached/templates/empty {% endif %} + {%- endif %} - watch_in: - service: memcached - require: - user: memcached_user +{%- if grains['os_family'] == 'Suse' %} +memcached_settings_suse: + file.keyvalue: + - name: {{ memcached.config_file }} + - separator: '=' + - key_values: + MEMCACHED_USER: '{{ get_config_item('user') }}' + MEMCACHED_GROUP: '{{ get_config_item('group') }}' + MEMCACHED_PARAMS: '-l {{ get_config_item('listen_address') }}' + - watch_in: + - service: memcached +{%- endif %} diff --git a/memcached/map.jinja b/memcached/map.jinja index 3fa0e1d..2abe215 100644 --- a/memcached/map.jinja +++ b/memcached/map.jinja @@ -35,6 +35,8 @@ 'config_file': '/etc/memcached.conf', 'libmemcached': 'libmemcached-devel', 'rootuser': rootuser, + 'user': 'memcached', + 'group': 'memcached', }, 'FreeBSD':{ 'server': 'memcached',