From e69a0ccb0f269f5d71cae0e6ab3a97d7ef2b7fe8 Mon Sep 17 00:00:00 2001 From: N Date: Mon, 18 Feb 2019 12:19:26 +0000 Subject: [PATCH 1/2] Suse support --- memcached/map.jinja | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/memcached/map.jinja b/memcached/map.jinja index cd3ffe7..7c47e46 100644 --- a/memcached/map.jinja +++ b/memcached/map.jinja @@ -15,6 +15,13 @@ } } %} {% set memcached = salt['grains.filter_by']({ + 'Suse':{ + 'server': 'memcached', + 'service': 'memcached', + 'python': 'python-python-memcache', + 'config_file': '/etc/memcached.conf', + 'libmemcached': 'libmemcached-devel', + }, 'Debian':{ 'server': 'memcached', 'service': 'memcached', From 6525a253dc28e1dccaafec8039434f4ec6451cd9 Mon Sep 17 00:00:00 2001 From: N Date: Sat, 28 Mar 2020 01:18:01 +0000 Subject: [PATCH 2/2] feat(freebsd): add freebsd support --- README.rst | 2 +- memcached/init.sls | 21 +++++++++++++++++++-- memcached/map.jinja | 6 ++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index f198283..3ba158b 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ memcached ========= -Install and start the memcached service +Install and start the memcached service on GNU/Linux and FreeBSD .. note:: diff --git a/memcached/init.sls b/memcached/init.sls index 782abed..a97ffad 100644 --- a/memcached/init.sls +++ b/memcached/init.sls @@ -1,10 +1,27 @@ {% from 'memcached/map.jinja' import memcached with context %} memcached: + {%- if grains.os_family in ('FreeBSD',) %} + cmd.run: + - names: + - portsnap fetch + - portsnap extract + - cd /usr/ports/distfiles + - curl -LO https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-2.1.27/cyrus-sasl-2.1.27.tar.gz + - cd /usr/ports/databases/memcached && make deinstall && make install clean + - env: + - BATCH: 'yes' + sysrc.managed: + - name: memcached_enable + - value: YES + - require: + - cmd: memcached + {%- else %} pkg.installed: - name: {{ memcached.server }} + {%- endif %} + - require_in: + - service: memcached service.running: - enable: True - name: {{ memcached.service }} - - require: - - pkg: memcached diff --git a/memcached/map.jinja b/memcached/map.jinja index 4cde10e..cb70780 100644 --- a/memcached/map.jinja +++ b/memcached/map.jinja @@ -22,6 +22,12 @@ 'config_file': '/etc/memcached.conf', 'libmemcached': 'libmemcached-devel', }, + 'FreeBSD':{ + 'server': 'memcached', + 'service': 'memcached', + 'config_file': '/usr/local/etc/rc.d/memcached', + 'libmemcached': 'libmemcached-devel', + }, 'Debian':{ 'server': 'memcached', 'service': 'memcached',