2020-08-01 14:52:38 +02:00
|
|
|
{%- if grains.os == 'MacOS' %}
|
|
|
|
{%- set rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %}
|
|
|
|
{%- else %}
|
|
|
|
{%- set rootuser == 'root' %}
|
|
|
|
{%- endif %}
|
|
|
|
|
2014-01-21 00:51:49 +01:00
|
|
|
{% set defaults = {
|
|
|
|
'config':{
|
2017-06-22 10:44:14 +02:00
|
|
|
'daemonize': True,
|
2014-01-21 00:51:49 +01:00
|
|
|
'verbose_level': 0,
|
2014-03-01 15:28:32 +01:00
|
|
|
'log_file': '/var/log/memcached.log',
|
2014-01-21 00:51:49 +01:00
|
|
|
'memory_cap': 64,
|
|
|
|
'port': 11211,
|
2014-01-21 01:05:31 +01:00
|
|
|
'user':' memcache',
|
2014-01-21 00:51:49 +01:00
|
|
|
'listen_address': '127.0.0.1',
|
|
|
|
'max_connections': 1024,
|
|
|
|
'lock_paged_memory': False,
|
|
|
|
'error_on_mem_full': False,
|
|
|
|
'max_core_file_limit': False,
|
2016-08-08 23:46:59 +02:00
|
|
|
'slab_size_limit': '1m',
|
2017-06-22 10:44:14 +02:00
|
|
|
}
|
2014-01-21 00:51:49 +01:00
|
|
|
} %}
|
2014-07-28 05:10:45 +02:00
|
|
|
{% set memcached = salt['grains.filter_by']({
|
2020-08-01 14:52:38 +02:00
|
|
|
'Default':{
|
|
|
|
'server': 'memcached',
|
|
|
|
'service': 'memcached',
|
|
|
|
'python': 'python-python-memcached',
|
|
|
|
'config_file': '/etc/memcached.conf',
|
|
|
|
'rootuser': {{ rootuser }},
|
|
|
|
},
|
2019-02-18 13:19:26 +01:00
|
|
|
'Suse':{
|
|
|
|
'server': 'memcached',
|
|
|
|
'service': 'memcached',
|
|
|
|
'python': 'python-python-memcached',
|
|
|
|
'config_file': '/etc/memcached.conf',
|
|
|
|
'libmemcached': 'libmemcached-devel',
|
2020-08-01 14:52:38 +02:00
|
|
|
'rootuser': {{ rootuser }},
|
2019-02-18 13:19:26 +01:00
|
|
|
},
|
2020-03-28 02:18:01 +01:00
|
|
|
'FreeBSD':{
|
|
|
|
'server': 'memcached',
|
|
|
|
'service': 'memcached',
|
|
|
|
'config_file': '/usr/local/etc/rc.d/memcached',
|
|
|
|
'libmemcached': 'libmemcached-devel',
|
2020-08-01 14:52:38 +02:00
|
|
|
'rootuser': {{ rootuser }},
|
2020-03-28 02:18:01 +01:00
|
|
|
},
|
2014-07-28 05:10:45 +02:00
|
|
|
'Debian':{
|
|
|
|
'server': 'memcached',
|
|
|
|
'service': 'memcached',
|
|
|
|
'python': 'python-memcache',
|
2014-11-17 20:10:20 +01:00
|
|
|
'config_file': '/etc/memcached.conf',
|
2014-12-02 17:28:48 +01:00
|
|
|
'libmemcached': 'libmemcached-dev',
|
2020-08-01 14:52:38 +02:00
|
|
|
'rootuser': {{ rootuser }},
|
2014-07-28 05:10:45 +02:00
|
|
|
},
|
|
|
|
'RedHat': {
|
|
|
|
'server': 'memcached',
|
|
|
|
'service': 'memcached',
|
|
|
|
'python': 'python-memcached',
|
2014-11-17 20:10:20 +01:00
|
|
|
'config_file': '/etc/sysconfig/memcached',
|
2014-12-02 17:28:48 +01:00
|
|
|
'libmemcached': 'libmemcached-devel',
|
2020-08-01 14:52:38 +02:00
|
|
|
'rootuser': {{ rootuser }},
|
2014-07-28 05:10:45 +02:00
|
|
|
},
|
2014-12-03 09:31:50 +01:00
|
|
|
'Gentoo':{
|
|
|
|
'server': 'net-misc/memcached',
|
|
|
|
'service': 'memcached',
|
|
|
|
'python': 'dev-python/python-memcache',
|
|
|
|
'config_file': '/etc/conf.d/memcached',
|
|
|
|
'libmemcached': 'dev-libs/libmemcached',
|
2020-08-01 14:52:38 +02:00
|
|
|
'rootuser': {{ rootuser }},
|
2014-12-03 09:31:50 +01:00
|
|
|
},
|
2015-09-10 21:19:08 +02:00
|
|
|
'Arch':{
|
|
|
|
'server': 'memcached',
|
|
|
|
'service': 'memcached',
|
|
|
|
'python': 'python2-memcached',
|
|
|
|
'config_file': '/etc/memcached',
|
|
|
|
'libmemcached': 'libmemcached',
|
2020-08-01 14:52:38 +02:00
|
|
|
'rootuser': {{ rootuser }},
|
2015-09-10 21:19:08 +02:00
|
|
|
},
|
2014-07-28 05:10:45 +02:00
|
|
|
}, merge=salt['pillar.get']('memcached:lookup')) %}
|