Skip to content

Commit

Permalink
fix(linux): service.args is freebsd
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Aug 18, 2020
1 parent 9b6c13d commit ceb9863
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
5 changes: 4 additions & 1 deletion prometheus/service/args/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
{%- if grains.os_family in ('FreeBSD',) %}
{%- set sls_service_clean = tplroot ~ '.service.clean' %}
include:
- {{ sls_service_clean }}
Expand Down Expand Up @@ -36,3 +38,4 @@ prometheus-service-args-clean-{{ name }}:
{%- endif %}
{%- endfor %}
{%- endif %}
11 changes: 8 additions & 3 deletions prometheus/service/args/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
{%- set sls_config_users = tplroot ~ '.config.users' %}
{%- set sls_archive_install = tplroot ~ '.archive.install' %}
{%- set sls_package_install = tplroot ~ '.package.install' %}
{%- if grains.os_family in ('FreeBSD',) %}
{%- set sls_config_users = tplroot ~ '.config.users' %}
{%- set sls_service_running = tplroot ~ '.service.running' %}
{%- set sls_archive_install = tplroot ~ '.archive.install' %}
{%- set sls_package_install = tplroot ~ '.package.install' %}
include:
- {{ sls_archive_install if p.pkg.use_upstream_archive else sls_package_install }}
- {{ sls_config_users }}
- {{ sls_service_running }}
{%- for name in p.wanted.component %}
{%- if 'service' in p.pkg.component[name] and 'args' in p.pkg.component[name]['service'] %}
Expand Down Expand Up @@ -73,3 +77,4 @@ prometheus-service-args-{{ name }}-install:
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endif %}
4 changes: 0 additions & 4 deletions prometheus/service/running.sls
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- set sls_config_file = tplroot ~ '.config.file' %}
{%- set sls_config_environ = tplroot ~ '.config.environ' %}
{%- set sls_service_args = tplroot ~ '.service.args.install' %}
include:
- {{ sls_service_args }}
- {{ sls_config_file }}
- {{ sls_config_environ }}
Expand All @@ -25,7 +23,6 @@ prometheus-service-running-{{ name }}-unmasked:
- require_in:
- service: prometheus-service-running-{{ name }}
- require:
- sls: {{ sls_service_args }}
- sls: {{ sls_config_file }}
- file: prometheus-config-file-etc-file-directory
Expand All @@ -43,7 +40,6 @@ prometheus-service-running-{{ name }}:
{%- endif %}
- enable: True
- require:
- sls: {{ sls_service_args }}
- sls: {{ sls_config_file }}
{%- if p.wanted.firewall %}
firewalld.present:
Expand Down

0 comments on commit ceb9863

Please sign in to comment.