paulbsd-salt/states/grafana/archive/install.sls
Paul cb296a3e30
All checks were successful
continuous-integration/drone/push Build is passing
updated grafana state
2025-03-14 23:24:56 +01:00

53 lines
1.3 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
- if_missing: {{ grafana.pkg.archive.name }}/bin/grafana
- user: {{ grafana.service.user }}
- group: {{ grafana.service.group }}
- recurse:
- user
- group
{%- endif %}