# -*- coding: utf-8 -*-
# vim: ft=yaml
#
# Setup variables using grains['os_family'] based logic.
# You just need to add the key:values for an `os_family` that differ
# from `defaults.yaml`.
# Only add an `os_family` which is/will be supported by the formula
#
# If you do not need to provide defaults via the `os_family` grain,
# you will need to provide at least an empty dict in this file, e.g.
# osfamilymap: {}
---
{%- if grains.os == 'MacOS' %}
  {% set macos_user = salt['cmd.run']("stat -f '%Su' /dev/console") %}
  {% set macos_group = salt['cmd.run']("stat -f '%Sg' /dev/console") %}
{%- endif %}

Debian:
  pkg:
    use_upstream_repo: True
    repo:
      humanname: grafana_official
      name: deb https://packages.grafana.com/oss/deb stable main
      file: /etc/apt/sources.list.d/grafana.list
      key_url: https://packages.grafana.com/gpg.key

RedHat:
  pkg:
    use_upstream_repo: True
    repo:
      baseurl: https://packages.grafana.com/oss/rpm-beta
      repo_gpgcheck: 1
      gpgkey: https://packages.grafana.com/gpg.key
      sslverify: 1
      sslcacert: /etc/pki/tls/certs/ca-bundle.crt
      comments:
        - instructions from https://grafana.com/docs/installation/rpm/

Suse:
  pkg:
    use_upstream_repo: True
    repo:
      baseurl: https://packages.grafana.com/oss/rpm-beta
      repo_gpgcheck: 1
      gpgkey: https://packages.grafana.com/gpg.key
      sslverify: 1
      sslcacert: /etc/pki/tls/certs/ca-bundle.crt
      comments:
        - instructions from https://grafana.com/docs/installation/rpm/

Gentoo: {}

Arch: {}

Alpine: {}

FreeBSD:
  pkg:
    name: grafana5
  config_file: /usr/local/etc/grafana.conf
  config:
    paths:
      data: /var/db/grafana/
      logs: /var/log/grafana/
      plugins: /var/db/grafana/plugins
      provisioning: /var/db/grafana/provisioning
    database:
      log_queries: ''
  service:
    name: grafana

OpenBSD: {}

Solaris: {}

Windows:
  dir: C:\\Program Files
  pkg:
    archive:
      name: C:\\Program Files
      archive_suffix: zip
      archive_format: zip

MacOS:
  rootuser: {{ macos_user | d('') }}
  rootgroup: {{ macos_group | d('') }}
  group: {{ macos_group | d('') }}
  service:
    name: grafana
    rootgroup: {{ macos_group | d('') }}
    group: {{ macos_group | d('') }}