2020-05-14 01:27:23 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
|
|
|
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
|
|
|
|
{%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
|
|
|
|
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
|
|
|
|
{%- set sls_archive_install = tplroot ~ '.archive.install' %}
|
|
|
|
{%- set sls_package_install = tplroot ~ '.package.install' %}
|
|
|
|
|
|
|
|
include:
|
|
|
|
- {{ sls_archive_install if p.pkg.use_upstream_archive else sls_package_install }}
|
|
|
|
|
|
|
|
{%- for name in p.wanted.clientlibs %}
|
|
|
|
|
|
|
|
prometheus-clientlibs-install-{{ name }}:
|
|
|
|
file.directory:
|
|
|
|
- name: {{ p.pkg.clientlibs[name]['path'] }}
|
|
|
|
- makedirs: True
|
|
|
|
- require_in:
|
|
|
|
- archive: prometheus-clientlibs-install-{{ name }}
|
2020-11-03 10:34:46 +01:00
|
|
|
{%- if grains.os|lower != 'windows' %}
|
|
|
|
- user: {{ p.identity.rootuser }}
|
|
|
|
- group: {{ p.identity.rootgroup }}
|
|
|
|
- mode: '0755'
|
2020-05-14 01:27:23 +02:00
|
|
|
- recurse:
|
|
|
|
- user
|
|
|
|
- group
|
|
|
|
- mode
|
2020-11-03 10:34:46 +01:00
|
|
|
{%- endif %}
|
2021-07-16 04:22:44 +02:00
|
|
|
{%- if grains.get('osfinger', '') in ['Oracle Linux Server-8', 'Amazon Linux-2'] %}
|
2021-02-27 22:57:13 +01:00
|
|
|
pkg.installed:
|
|
|
|
- name: tar
|
|
|
|
- require_in:
|
|
|
|
- archive: prometheus-clientlibs-install-{{ name }}
|
|
|
|
{%- endif %}
|
2020-05-14 01:27:23 +02:00
|
|
|
archive.extracted:
|
|
|
|
{{- format_kwargs(p.pkg.clientlibs[name]['archive']) }}
|
|
|
|
- trim_output: true
|
|
|
|
- enforce_toplevel: false
|
2020-10-19 14:57:29 +02:00
|
|
|
- force: {{ p.force }}
|
2020-05-14 01:27:23 +02:00
|
|
|
- options: --strip-components=1
|
|
|
|
- retry: {{ p.retry_option|json }}
|
2020-11-03 10:34:46 +01:00
|
|
|
{%- if grains.os|lower != 'windows' %}
|
2020-05-14 01:27:23 +02:00
|
|
|
- user: {{ p.identity.rootuser }}
|
|
|
|
- group: {{ p.identity.rootgroup }}
|
2020-11-03 10:34:46 +01:00
|
|
|
{%- endif %}
|
2020-05-14 01:27:23 +02:00
|
|
|
|
|
|
|
{%- endfor %}
|