paulbsd-salt/states/grafana/archive/install.sls
2021-09-25 16:12:02 +02:00

52 lines
1.2 KiB
Plaintext

# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import grafana with context %}
{%- from tplroot ~ "/jinja/macros.jinja" import format_kwargs with context %}
{%- if grafana.pkg.use_upstream_archive %}
grafana-group:
user.present:
- name: {{ grafana.service.group }}
- system: True
grafana-user:
user.present:
- name: {{ grafana.service.user }}
- system: True
- groups:
- {{ grafana.service.group }}
grafana-package-archive-install-file-directory:
file.directory:
- name: {{ grafana.pkg.archive.name }}
- user: {{ grafana.service.user }}
- group: {{ grafana.service.group }}
- mode: 755
- makedirs: True
- require_in:
- archive: grafana-package-archive-install-archive-extracted
- recurse:
- user
- group
- mode
grafana-package-archive-install-archive-extracted:
archive.extracted:
{{- format_kwargs(grafana.pkg.archive) }}
- retry:
attempts: 3
until: True
interval: 60
splay: 10
- user: {{ grafana.service.user }}
- group: {{ grafana.service.group }}
- recurse:
- user
- group
{%- endif %}