From 18ba4a8c799846b4ab4fe44688d0ee315f9605bf Mon Sep 17 00:00:00 2001 From: Nicolas Delaby Date: Wed, 3 Dec 2014 09:31:50 +0100 Subject: [PATCH] Add Gentoo flavor --- memcached/config.sls | 2 ++ memcached/map.jinja | 7 ++++++ memcached/templates/conf.d/memcached | 36 ++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 memcached/templates/conf.d/memcached diff --git a/memcached/config.sls b/memcached/config.sls index dd1214e..bf48ff8 100644 --- a/memcached/config.sls +++ b/memcached/config.sls @@ -14,6 +14,8 @@ include: - source: salt://memcached/templates/memcached.conf {% elif grains['os_family'] == 'RedHat' %} - source: salt://memcached/templates/sysconfig/memcached + {% elif grains['os_family'] == 'Gentoo' %} + - source: salt://memcached/templates/conf.d/memcached {% endif %} - watch_in: - service: memcached diff --git a/memcached/map.jinja b/memcached/map.jinja index ac42ecc..3794859 100644 --- a/memcached/map.jinja +++ b/memcached/map.jinja @@ -28,4 +28,11 @@ 'config_file': '/etc/sysconfig/memcached', 'libmemcached': 'libmemcached-devel', }, + 'Gentoo':{ + 'server': 'net-misc/memcached', + 'service': 'memcached', + 'python': 'dev-python/python-memcache', + 'config_file': '/etc/conf.d/memcached', + 'libmemcached': 'dev-libs/libmemcached', + }, }, merge=salt['pillar.get']('memcached:lookup')) %} diff --git a/memcached/templates/conf.d/memcached b/memcached/templates/conf.d/memcached new file mode 100644 index 0000000..185b49e --- /dev/null +++ b/memcached/templates/conf.d/memcached @@ -0,0 +1,36 @@ +{% from 'memcached/macros.sls' import get_config_item with context -%} +# Copyright 2003 Gentoo Technologies, Inc +# $Header: /var/cvsroot/gentoo-x86/net-misc/memcached/files/1.3.3/conf,v 1.1 2009/05/26 00:03:09 robbat2 Exp $ +# memcached config file + +MEMCACHED_BINARY="/usr/bin/memcached" + +#Specify memory usage in megabytes (do not use letters) +#64MB is default +MEMUSAGE="{{ get_config_item('memory_cap') }}" + +#User to run as +MEMCACHED_RUNAS="memcached" + +#Specify maximum number of concurrent connections +#1024 is default +MAXCONN="{{ get_config_item('max_connections') }}" + +#Listen for connections on what address? +# If this is empty, memcached will listen on 0.0.0.0 +# be sure you have a firewall in place! +LISTENON="{{ get_config_item('listen_address') }}" + +#Listen for connections on what port? +PORT="{{ get_config_item('port') }}" + +# Listen for UDP connecitons on what port? 0 means turn off UDP +UDPPORT="0" + +#PID file location +# '-${PORT}.${CONF}.pid' will be appended to this! +# You do not normally need to change this. +PIDBASE="/var/run/memcached/memcached" + +#Other Options +MISC_OPTS=""