-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(suse): basic opensuse support; tidyup
- Loading branch information
1 parent
f86a718
commit f29f544
Showing
7 changed files
with
131 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
######################################################### | ||
# File managed by Salt. Changes risk being overwritten. | ||
######################################################### | ||
[Unit] | ||
Description={{ desc }} | ||
Wants=network-online.target | ||
After= | ||
Documentation=https://github.com/saltstack-formulas/prometheus-formula | ||
|
||
[Service] | ||
User={{ user }} | ||
Group={{ group }} | ||
WorkingDirectory={{ workdir }} | ||
ExecStart={{ start }} | ||
ExecStop={{ stop }} | ||
PIDFile=/var/run/{{ name }}.pid | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=jinja | ||
# | ||
# Collection of common macros | ||
|
||
{%- macro format_kwargs(kwarg) -%} | ||
{%- if kwarg and kwarg is mapping %} | ||
|
||
{%- filter indent(4) %} | ||
{%- for k, v in kwarg|dictsort() %} | ||
- {{ k }}: {{ v }} | ||
{%- endfor %} | ||
{%- endfilter %} | ||
|
||
{%- endif %} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,44 @@ | ||
|
||
{%- from "redis/map.jinja" import redis_settings with context %} | ||
{%- set cfg_name = redis_settings.cfg_name -%} | ||
{%- set install_from = redis_settings.install_from -%} | ||
{%- set svc_name = redis_settings.svc_name -%} | ||
{%- set port = redis_settings.port -%} | ||
{%- from "redis/map.jinja" import redis_settings as r with context %} | ||
redis-server-service-clean: | ||
service.dead: | ||
{%- if install_from == 'source' %} | ||
- name: {{ svc_name }}_{{ port }} | ||
{%- if r.install_from in ('source', 'archive') %} | ||
- name: {{ r.svc_name }}_{{ r.port }} | ||
{%- else %} | ||
- name: {{ svc_name }} | ||
- name: {{ r.svc_name }} | ||
{%- endif %} | ||
- enable: false | ||
- require_in: | ||
- user: redis-server-clean | ||
- file: redis-server-clean | ||
redis-server-clean: | ||
{%- if install_from == 'source' %} | ||
{%- set user = redis_settings.user -%} | ||
{%- set group = redis_settings.group -%} | ||
{%- if r.install_from in ('source', 'archive') %} | ||
user.absent: | ||
- name: {{ user }} | ||
- name: {{ r.user }} | ||
group.absent: | ||
- name: {{ group }} | ||
- name: {{ r.group }} | ||
- require: | ||
- user: redis-server-clean | ||
file.absent: | ||
- names: | ||
- /etc/init/redis-server.conf | ||
- /var/log/redis | ||
- {{ cfg_name }} | ||
- {{ r.cfg_name }} | ||
- /etc/init.d/redis | ||
- {{ redis_settings.root|default('/usr/local') }} | ||
- {{ r.root|default('/usr/local') }} | ||
- /etc/redis | ||
- /var/log/redis | ||
- /var/lib/redis | ||
- /usr/lib/systemd/system/redis* | ||
- /lib/systemd/system/redis* | ||
- /var/run/redis | ||
- /var/run/redis_6379.pid | ||
{%- else %} | ||
pkg.removed: | ||
- name: {{ redis_settings.pkg_name }} | ||
- name: {{ r.pkg_name }} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters