Skip to content

Commit

Permalink
feat(arch): add support for archlinux
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Dec 3, 2020
1 parent 32cb1c2 commit 02c1d2f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 23 deletions.
26 changes: 12 additions & 14 deletions redis/common.sls
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ get-redis:
- watch:
- file: get-redis
make-and-install-redis:
cmd.wait:
- cwd: {{ root }}/redis-{{ version }}
Expand Down Expand Up @@ -70,20 +69,23 @@ install-redis:
- version: {{ redis_settings.version }}
- ignore_epoch: True
{% endif %}
{% endif %}
{%- if grains.os_family|lower == 'suse' %}
{# this is basically a workaround for faulty packaging #}
install-redis-log:
install-redis-user-group:
group.present:
- name: {{ redis_settings.group }}
user.present:
- name: {{ redis_settings.user }}
- gid_from_name: True
- home: {{ redis_settings.home }}
- require:
- group: install-redis-log
- group: install-redis-user-group
- require_in:
- file: install-redis-log-dir
install-redis-log-dir:
file.directory:
- name: /var/log/redis
- name: {{ redis_settings.dir.log }}
- mode: 755
- user: {{ redis_settings.user }}
- group: {{ redis_settings.group }}
Expand All @@ -92,18 +94,14 @@ install-redis-log:
- group
- mode
- makedirs: True
- require:
- user: install-redis-log
install-redis-service:
file.replace:
- name: /usr/lib/systemd/system/redis@.service
- name: {{ redis_settings.dir.service }}/{{ redis_settings.svc_name }}
- pattern: ^Type=notify
- repl: Type=simple
- onlyif: test -f {{ redis_settings.dir.service }}/{{ redis_settings.svc_name }}
cmd.run:
- name: systemctl daemon-reload
- require:
- file: install-redis-log
{% endif %}
{% endif %}
- onchanges:
- file: install-redis-log-dir
4 changes: 4 additions & 0 deletions redis/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ redis:
dbfilename: dump-{name}.rdb
svc_state: running
svc_onboot: true
dir:
log: /var/log/redis
service: /lib/systemd/system
appendfilename: appendonly.aof
appendonly: 'no'
appendfsync: everysec
Expand Down Expand Up @@ -52,6 +55,7 @@ redis:
- '60 10000'
stop_writes_on_bgsave_error: 'yes'
svc_onboot: true
svc_name: redis
svc_state: running
timeout: 0
tcp_backlog: 511
Expand Down
2 changes: 1 addition & 1 deletion redis/instances.sls
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include:
redis_systemd_template:
file.managed:
- name: /lib/systemd/system/redis-server@.service
- name: {{ redis_settings.dir.service }}/redis-server@.service
- replace: False
- source: salt://redis/files/redis-server@.service
Expand Down
4 changes: 0 additions & 4 deletions redis/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Debian:
RedHat:
pkg_name: redis
python_dev_package: python-devel
svc_name: redis
cfg_name: /etc/redis.conf
cfg_version: '3.0'
logfile: /var/log/redis/redis.log
Expand All @@ -27,15 +26,13 @@ RedHat:
pidfile: /var/run/redis/sentinel.pid
Arch:
pkg_name: redis
svc_name: redis
cfg_name: /etc/redis.conf
cfg_version: '3.0'
logfile: /var/log/redis/redis.log
pidfile: /var/run/redis.pid
daemonize: 'no'
FreeBSD:
pkg_name: redis
svc_name: redis
cfg_name: /usr/local/etc/redis.conf
cfg_version: '3.0'
logfile: /var/log/redis/redis.log
Expand All @@ -56,4 +53,3 @@ Suse:
sentinel:
pidfile: /var/run/redis/sentinel.pid
disable_transparent_huge_pages: true
systemd_type: simple
6 changes: 2 additions & 4 deletions redis/server/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ redis-server-clean:
- /etc/init.d/redis
- {{ r.root|default('/usr/local') }}
- /etc/redis
- /var/log/redis
- /var/lib/redis
- /usr/lib/systemd/system/redis*
- /lib/systemd/system/redis*
- {{ r.dir.log }}
- {{ r.dir.service }}/redis*
- /var/run/redis
- /var/run/redis_6379.pid
Expand Down

0 comments on commit 02c1d2f

Please sign in to comment.