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 %}
pkg.installed:
- name: {{ memcached.server }}
- runas: {{ memcached.rootuser }}
{%- endif %}
- require_in:
- 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 = {
'config':{
'daemonize': True,
@ -15,18 +21,27 @@
}
} %}
{% set memcached = salt['grains.filter_by']({
'Default':{
'server': 'memcached',
'service': 'memcached',
'python': 'python-python-memcached',
'config_file': '/etc/memcached.conf',
'rootuser': {{ rootuser }},
},
'Suse':{
'server': 'memcached',
'service': 'memcached',
'python': 'python-python-memcached',
'config_file': '/etc/memcached.conf',
'libmemcached': 'libmemcached-devel',
'rootuser': {{ rootuser }},
},
'FreeBSD':{
'server': 'memcached',
'service': 'memcached',
'config_file': '/usr/local/etc/rc.d/memcached',
'libmemcached': 'libmemcached-devel',
'rootuser': {{ rootuser }},
},
'Debian':{
'server': 'memcached',
@ -34,6 +49,7 @@
'python': 'python-memcache',
'config_file': '/etc/memcached.conf',
'libmemcached': 'libmemcached-dev',
'rootuser': {{ rootuser }},
},
'RedHat': {
'server': 'memcached',
@ -41,6 +57,7 @@
'python': 'python-memcached',
'config_file': '/etc/sysconfig/memcached',
'libmemcached': 'libmemcached-devel',
'rootuser': {{ rootuser }},
},
'Gentoo':{
'server': 'net-misc/memcached',
@ -48,6 +65,7 @@
'python': 'dev-python/python-memcache',
'config_file': '/etc/conf.d/memcached',
'libmemcached': 'dev-libs/libmemcached',
'rootuser': {{ rootuser }},
},
'Arch':{
'server': 'memcached',
@ -55,5 +73,6 @@
'python': 'python2-memcached',
'config_file': '/etc/memcached',
'libmemcached': 'libmemcached',
'rootuser': {{ rootuser }},
},
}, merge=salt['pillar.get']('memcached:lookup')) %}