fix(linux): service.args is freebsd

This commit is contained in:
noelmcloughlin 2020-08-18 21:18:52 +01:00
parent 9b6c13d62c
commit ceb9863749
3 changed files with 12 additions and 8 deletions

View File

@ -4,7 +4,9 @@
{%- set tplroot = tpldir.split('/')[0] %} {%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %} {%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch 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: include:
- {{ sls_service_clean }} - {{ sls_service_clean }}
@ -36,3 +38,4 @@ prometheus-service-args-clean-{{ name }}:
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- endif %}

View File

@ -4,14 +4,18 @@
{%- set tplroot = tpldir.split('/')[0] %} {%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %} {%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- from tplroot ~ "/libtofs.jinja" import files_switch 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' %} {%- if grains.os_family in ('FreeBSD',) %}
{%- set sls_package_install = tplroot ~ '.package.install' %} {%- 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: include:
- {{ sls_archive_install if p.pkg.use_upstream_archive else sls_package_install }} - {{ sls_archive_install if p.pkg.use_upstream_archive else sls_package_install }}
- {{ sls_config_users }} - {{ sls_config_users }}
- {{ sls_service_running }}
{%- for name in p.wanted.component %} {%- for name in p.wanted.component %}
{%- if 'service' in p.pkg.component[name] and 'args' in p.pkg.component[name]['service'] %} {%- if 'service' in p.pkg.component[name] and 'args' in p.pkg.component[name]['service'] %}
@ -73,3 +77,4 @@ prometheus-service-args-{{ name }}-install:
{%- endif %} {%- endif %}
{%- endif %} {%- endif %}
{%- endfor %} {%- endfor %}
{%- endif %}

View File

@ -5,10 +5,8 @@
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %} {%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- set sls_config_file = tplroot ~ '.config.file' %} {%- set sls_config_file = tplroot ~ '.config.file' %}
{%- set sls_config_environ = tplroot ~ '.config.environ' %} {%- set sls_config_environ = tplroot ~ '.config.environ' %}
{%- set sls_service_args = tplroot ~ '.service.args.install' %}
include: include:
- {{ sls_service_args }}
- {{ sls_config_file }} - {{ sls_config_file }}
- {{ sls_config_environ }} - {{ sls_config_environ }}
@ -25,7 +23,6 @@ prometheus-service-running-{{ name }}-unmasked:
- require_in: - require_in:
- service: prometheus-service-running-{{ name }} - service: prometheus-service-running-{{ name }}
- require: - require:
- sls: {{ sls_service_args }}
- sls: {{ sls_config_file }} - sls: {{ sls_config_file }}
- file: prometheus-config-file-etc-file-directory - file: prometheus-config-file-etc-file-directory
@ -43,7 +40,6 @@ prometheus-service-running-{{ name }}:
{%- endif %} {%- endif %}
- enable: True - enable: True
- require: - require:
- sls: {{ sls_service_args }}
- sls: {{ sls_config_file }} - sls: {{ sls_config_file }}
{%- if p.wanted.firewall %} {%- if p.wanted.firewall %}
firewalld.present: firewalld.present: