Merge pull request #26 from noelmcloughlin/fix

feat(macos): add darwin support
This commit is contained in:
N 2020-08-09 22:57:53 +02:00 committed by GitHub
commit 79a62c8ea6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View File

@ -19,6 +19,7 @@ memcached:
{%- else %} {%- else %}
pkg.installed: pkg.installed:
- name: {{ memcached.server }} - name: {{ memcached.server }}
- runas: {{ memcached.rootuser }}
{%- endif %} {%- endif %}
- require_in: - require_in:
- service: memcached - service: memcached

View File

@ -1,3 +1,9 @@
{%- if grains.os == 'MacOS' %}
{%- set rootuser = salt['cmd.run']("stat -f '%Su' /dev/console") %}
{%- else %}
{%- set rootuser == 'root' %}
{%- endif %}
{% set defaults = { {% set defaults = {
'config':{ 'config':{
'daemonize': True, 'daemonize': True,
@ -15,18 +21,27 @@
} }
} %} } %}
{% set memcached = salt['grains.filter_by']({ {% set memcached = salt['grains.filter_by']({
'Default':{
'server': 'memcached',
'service': 'memcached',
'python': 'python-python-memcached',
'config_file': '/etc/memcached.conf',
'rootuser': {{ rootuser }},
},
'Suse':{ 'Suse':{
'server': 'memcached', 'server': 'memcached',
'service': 'memcached', 'service': 'memcached',
'python': 'python-python-memcached', 'python': 'python-python-memcached',
'config_file': '/etc/memcached.conf', 'config_file': '/etc/memcached.conf',
'libmemcached': 'libmemcached-devel', 'libmemcached': 'libmemcached-devel',
'rootuser': {{ rootuser }},
}, },
'FreeBSD':{ 'FreeBSD':{
'server': 'memcached', 'server': 'memcached',
'service': 'memcached', 'service': 'memcached',
'config_file': '/usr/local/etc/rc.d/memcached', 'config_file': '/usr/local/etc/rc.d/memcached',
'libmemcached': 'libmemcached-devel', 'libmemcached': 'libmemcached-devel',
'rootuser': {{ rootuser }},
}, },
'Debian':{ 'Debian':{
'server': 'memcached', 'server': 'memcached',
@ -34,6 +49,7 @@
'python': 'python-memcache', 'python': 'python-memcache',
'config_file': '/etc/memcached.conf', 'config_file': '/etc/memcached.conf',
'libmemcached': 'libmemcached-dev', 'libmemcached': 'libmemcached-dev',
'rootuser': {{ rootuser }},
}, },
'RedHat': { 'RedHat': {
'server': 'memcached', 'server': 'memcached',
@ -41,6 +57,7 @@
'python': 'python-memcached', 'python': 'python-memcached',
'config_file': '/etc/sysconfig/memcached', 'config_file': '/etc/sysconfig/memcached',
'libmemcached': 'libmemcached-devel', 'libmemcached': 'libmemcached-devel',
'rootuser': {{ rootuser }},
}, },
'Gentoo':{ 'Gentoo':{
'server': 'net-misc/memcached', 'server': 'net-misc/memcached',
@ -48,6 +65,7 @@
'python': 'dev-python/python-memcache', 'python': 'dev-python/python-memcache',
'config_file': '/etc/conf.d/memcached', 'config_file': '/etc/conf.d/memcached',
'libmemcached': 'dev-libs/libmemcached', 'libmemcached': 'dev-libs/libmemcached',
'rootuser': {{ rootuser }},
}, },
'Arch':{ 'Arch':{
'server': 'memcached', 'server': 'memcached',
@ -55,5 +73,6 @@
'python': 'python2-memcached', 'python': 'python2-memcached',
'config_file': '/etc/memcached', 'config_file': '/etc/memcached',
'libmemcached': 'libmemcached', 'libmemcached': 'libmemcached',
'rootuser': {{ rootuser }},
}, },
}, merge=salt['pillar.get']('memcached:lookup')) %} }, merge=salt['pillar.get']('memcached:lookup')) %}