Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…a-formula into archives
  • Loading branch information
noelmcloughlin committed Jun 23, 2019
2 parents 27bc326 + bf6b17e commit 490be66
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 49 deletions.
4 changes: 2 additions & 2 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ This list is sorted by the number of commits per contributor in _descending_ ord

Avatar|Contributor|Contributions
:-:|---|:-:
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>|[@noelmcloughlin](https://github.com/noelmcloughlin)|2
<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>|[@noelmcloughlin](https://github.com/noelmcloughlin)|4
<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>|[@alxwr](https://github.com/alxwr)|1

---

Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-06-05.
Auto-generated by a [forked version](https://github.com/myii/maintainer) of [gaocegege/maintainer](https://github.com/gaocegege/maintainer) on 2019-06-23.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

# [2.0.0](https://github.com/saltstack-formulas/grafana-formula/compare/v1.1.1...v2.0.0) (2019-06-23)


### Features

* **repository:** support rpm-based linux distros ([ded3157](https://github.com/saltstack-formulas/grafana-formula/commit/ded3157))


### BREAKING CHANGES

* **repository:** the parameter `pkg` is now a dictionary. References
to `grafana.pkg` should be changed to `grafana.pkg.name`.

## [1.1.1](https://github.com/saltstack-formulas/grafana-formula/compare/v1.1.0...v1.1.1) (2019-06-23)


### Bug Fixes

* **macos:** fix service name on macos ([f28d08b](https://github.com/saltstack-formulas/grafana-formula/commit/f28d08b))

# [1.1.0](https://github.com/saltstack-formulas/grafana-formula/compare/v1.0.0...v1.1.0) (2019-06-05)


Expand Down
2 changes: 1 addition & 1 deletion FORMULA
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: grafana
os: FreeBSD
os_family: FreeBSD
version: 1.1.0
version: 2.0.0
release: 1
minimum_version: 2016.11
summary: Grafana formula
Expand Down
4 changes: 2 additions & 2 deletions docs/AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ This list is sorted by the number of commits per contributor in *descending* ord
- Contributions
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars1.githubusercontent.com/u/13322818?v=4' width='36' height='36' alt='@noelmcloughlin'>`
- `@noelmcloughlin <https://github.com/noelmcloughlin>`_
- 2
- 4
* - :raw-html-m2r:`<img class='float-left rounded-1' src='https://avatars0.githubusercontent.com/u/1920805?v=4' width='36' height='36' alt='@alxwr'>`
- `@alxwr <https://github.com/alxwr>`_
- 1


----

Auto-generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2019-06-05.
Auto-generated by a `forked version <https://github.com/myii/maintainer>`_ of `gaocegege/maintainer <https://github.com/gaocegege/maintainer>`_ on 2019-06-23.
25 changes: 25 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@
Changelog
=========

`2.0.0 <https://github.com/saltstack-formulas/grafana-formula/compare/v1.1.1...v2.0.0>`_ (2019-06-23)
---------------------------------------------------------------------------------------------------------

Features
^^^^^^^^


* **repository:** support rpm-based linux distros (\ `ded3157 <https://github.com/saltstack-formulas/grafana-formula/commit/ded3157>`_\ )

BREAKING CHANGES
^^^^^^^^^^^^^^^^


* **repository:** the parameter ``pkg`` is now a dictionary. References
to ``grafana.pkg`` should be changed to ``grafana.pkg.name``.

`1.1.1 <https://github.com/saltstack-formulas/grafana-formula/compare/v1.1.0...v1.1.1>`_ (2019-06-23)
---------------------------------------------------------------------------------------------------------

Bug Fixes
^^^^^^^^^


* **macos:** fix service name on macos (\ `f28d08b <https://github.com/saltstack-formulas/grafana-formula/commit/f28d08b>`_\ )

`1.1.0 <https://github.com/saltstack-formulas/grafana-formula/compare/v1.0.0...v1.1.0>`_ (2019-06-05)
---------------------------------------------------------------------------------------------------------

Expand Down
11 changes: 10 additions & 1 deletion grafana/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
grafana:
dir: /opt/grafana
version: '6.2.2'

pkg:
name: grafana
binary: grafana
use_upstream_archive: False
use_upstream_repo: False
repo:
humanname: grafana
name: grafana
comments:
- installed by salt
enabled: 1
gpgcheck: 1
archive:
name: /opt
uri: https://dl.grafana.com/oss/release
Expand All @@ -18,7 +27,7 @@ grafana:
archive_format: tar
enforce_toplevel: False # needed for grafana
options: '--strip-components=1' # needed for grafana
pkgrepo: {}

kernel: {{ grains.kernel | lower }}
rootgroup: root
group: grafana
Expand Down
42 changes: 34 additions & 8 deletions grafana/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,42 @@
# 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:
pkgrepo:
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
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: {}
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: {}
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: {}

Expand All @@ -32,7 +55,8 @@ Arch: {}
Alpine: {}

FreeBSD:
pkg: grafana5
pkg:
name: grafana5
config_file: /usr/local/etc/grafana.conf
config:
paths:
Expand All @@ -58,8 +82,10 @@ Windows:
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('') }}
11 changes: 7 additions & 4 deletions grafana/package/clean.sls
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@
include:
- {{ sls_config_clean }}
{%- if grafana.pkg.use_upstream_repo %}
include:
- .repo.clean
{%- endif %}
grafana-package-clean-pkg-removed:
pkg.removed:
- name: {{ grafana.pkg.name }}
{%- if 'config' in grafana and grafana.config %}
- require:
- sls: {{ sls_config_clean }}
{%- endif %}
# require:
# sls: {{ sls_config_clean }}
16 changes: 5 additions & 11 deletions grafana/package/install.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import grafana with context %}
{% if grafana.pkgrepo %}
grafana-package-install-pkgrepo-managed:
pkgrepo.managed:
- humanname: {{ grafana.pkgrepo.humanname }}
- name: {{ grafana.pkgrepo.name }}
- file: {{ grafana.pkgrepo.file}}
- key_url: {{ grafana.pkgrepo.key_url}}
- require_in:
- pkg: grafana-package-install-pkg-installed
{% endif %}
{%- if grafana.pkg.use_upstream_repo %}
include:
- .repo
{%- endif %}
grafana-package-install-pkg-installed:
pkg.installed:
Expand Down
10 changes: 10 additions & 0 deletions grafana/package/repo/clean.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import grafana with context %}
grafana-package-repo-clean-pkgrepo-absent:
pkgrepo.absent:
- name: {{ grafana.pkg.repo.name }}
5 changes: 5 additions & 0 deletions grafana/package/repo/init.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

include:
- .install
15 changes: 15 additions & 0 deletions grafana/package/repo/install.sls
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# -*- coding: utf-8 -*-
# vim: ft=sls

{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import grafana with context %}
{%- if grafana.pkg.use_upstream_repo %}
{%- from tplroot ~ "/jinja/macros.jinja" import format_kwargs with context %}
grafana-package-repo-install-pkgrepo-managed:
pkgrepo.managed:
{{- format_kwargs(grafana.pkg.repo) }}
{%- endif %}
37 changes: 17 additions & 20 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,25 @@ grafana:
use_upstream_archive: False
archive:
uri: https://dl.grafana.com/oss/release
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

pkgrepo:
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
config_file: /etc/grafana/grafana.ini
environ_file: /etc/default.grafana.sh
service:
name: grafana-server

linux:
#'Alternatives system' priority: zero disables (default)
altpriority: 1000
# Pillar-based config
# See also https://grafana.com/docs/installation/configuration/
config:
default:
instance_name: ${HOSTNAME}
security:
admin_user: admin
auth.google:
client_secret: 0ldS3cretKey

tofs:
# The files_switch key serves as a selector for alternative
Expand All @@ -45,14 +50,6 @@ grafana:
# - 'example_alt.tmpl'
# - 'example_alt.tmpl.jinja'

# Pillar-based config
# See also https://grafana.com/docs/installation/configuration/
environ:
- 'export PATH=${PATH}:/opt/grafana-6.2.2.darwin-amd64'
config:
default:
instance_name: ${HOSTNAME}
security:
admin_user: admin
auth.google:
client_secret: 0ldS3cretKey
linux:
#'Alternatives system' priority: zero disables (default)
altpriority: 1000

0 comments on commit 490be66

Please sign in to comment.