Merge pull request #38 from noelmcloughlin/i16

fix(linux): service.args is freebsd
This commit is contained in:
N 2020-08-19 01:28:28 +02:00 committed by GitHub
commit a0cec39d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 11 deletions

View File

@ -15,8 +15,8 @@ prometheus-archive-install-prerequisites:
- names: {{ p.pkg.deps|json }}
file.directory:
- name: {{ p.dir.var }}
- user: prometheus
- group: prometheus
- user: {{ p.identity.rootuser }}
- group: {{ p.identity.rootgroup }}
- mode: 755
- makedirs: True
- require:

View File

@ -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 }}
@ -36,3 +38,4 @@ prometheus-service-args-clean-{{ name }}:
{%- endif %}
{%- endfor %}
{%- endif %}

View File

@ -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'] %}
@ -73,3 +77,4 @@ prometheus-service-args-{{ name }}-install:
{%- endif %}
{%- endif %}
{%- endfor %}
{%- endif %}

View File

@ -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 }}
@ -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
@ -39,7 +36,6 @@ prometheus-service-running-{{ name }}:
- onlyif: systemctl list-units | grep {{ service_name }} >/dev/null 2>&1
- enable: True
- require:
- sls: {{ sls_service_args }}
- sls: {{ sls_config_file }}
- names:
- {{ service_name }}

View File

@ -26,7 +26,6 @@ control 'prometheus components' do
end
describe directory('/var/lib/prometheus') do
it { should exist }
its('group') { should eq 'prometheus' }
end
describe directory('/opt/prometheus/prometheus-v2.10.0') do
it { should exist }