-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(archives): support for archives file format
BREAKING CHANGE: the parameter `pkg` is now a dictionary. References to `prometheus.pkg` should be changed to `prometheus.pkg.name`.
- Loading branch information
1 parent
ea84c92
commit 1f86f4a
Showing
23 changed files
with
236 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{#- Get the `tplroot` from `tpldir` #} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import prometheus with context %} | ||
prometheus-cli-package-archive-clean-file-absent: | ||
file.absent: | ||
- names: | ||
- {{ prometheus.base_dir }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#.-*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
include: | ||
- .install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{#- Get the `tplroot` from `tpldir` #} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import prometheus with context %} | ||
{%- from tplroot ~ "/jinja/macros.jinja" import format_kwargs with context %} | ||
prometheus-package-archive-install-file-directory: | ||
file.directory: | ||
- name: {{ prometheus.pkg.archive.name }} | ||
- makedirs: True | ||
- require_in: | ||
- archive: prometheus-package-archive-install-archive-extracted | ||
prometheus-package-archive-install-archive-extracted: | ||
archive.extracted: | ||
{{- format_kwargs(prometheus.pkg.archive) }} | ||
- retry: | ||
attempts: 3 | ||
until: True | ||
interval: 60 | ||
splay: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ | |
include: | ||
- .service.clean | ||
- .config.clean | ||
- .archive.clean | ||
- .package.clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{#- Get the `tplroot` from `tpldir` #} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import prometheus with context %} | ||
{%- set sls_archive_install = tplroot ~ '.archive.install' %} | ||
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} | ||
include: | ||
- {{ sls_archive_install }} | ||
prometheus-config-file-file-managed-environ_file: | ||
file.managed: | ||
- name: {{ prometheus.environ_file }} | ||
- source: {{ files_switch(['prometheus.sh.jinja'], | ||
lookup='prometheus-config-file-file-managed-environ_file' | ||
) | ||
}} | ||
- mode: 644 | ||
- user: root | ||
- group: {{ prometheus.rootgroup }} | ||
- makedirs: True | ||
- template: jinja | ||
- context: | ||
prometheus: {{ prometheus|json }} | ||
- require: | ||
- sls: {{ sls_archive_install }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
include: | ||
- .args | ||
- .file | ||
- .environ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
######################################################################## | ||
# File managed by Salt at <{{ source }}>. | ||
# Your changes may be overwritten. | ||
######################################################################## | ||
|
||
{%- if prometheus.environ %} | ||
{%- for item in prometheus.environ %} | ||
{{ item }} | ||
{%- endfor %} | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
######################################################################## | ||
# File managed by Salt at <{{ source }}>. | ||
# Your changes will be overwritten. | ||
# Your changes may be overwritten. | ||
######################################################################## | ||
|
||
{{ config|yaml(False) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,11 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=sls | ||
|
||
{#- Get the `tplroot` from `tpldir` #} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import prometheus with context %} | ||
include: | ||
- .package | ||
- {{ '.archive' if prometheus.pkg.use_upstream_archive else '.package' }} | ||
- .config | ||
- .service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=jinja | ||
# | ||
# Collection of common macros | ||
|
||
{%- macro format_kwargs(kwarg) -%} | ||
{%- filter indent(4) %} | ||
{%- for k, v in kwarg|dictsort() %} | ||
- {{ k }}: {{ v }} | ||
{%- endfor %} | ||
{%- endfilter %} | ||
{%- endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
# | ||
# Setup variables using grains['osarch'] based logic. | ||
# You just need to add the key:values for an `osarch` that differ | ||
# from `defaults.yaml` + `os_family.yaml`. | ||
# Only add an `osarch` which is/will be supported by the formula | ||
# | ||
# If you do not need to provide defaults via the `osarch` grain, | ||
# you will need to provide at least an empty dict in this file, e.g. | ||
# osarch: {} | ||
--- | ||
amd64: | ||
arch: amd64 | ||
|
||
x86_64: | ||
arch: amd64 | ||
|
||
386: | ||
arch: 386 | ||
|
||
arm64: | ||
arch: arm64 | ||
|
||
armv6l: | ||
arch: armv6l | ||
|
||
armv7l: | ||
arch: armv6l | ||
|
||
ppc64le: | ||
arch: ppc64le | ||
|
||
s390x: | ||
arch: s390x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.