feat(debian): allow to install using OS packages

This commit is contained in:
Javier Bértoli 2020-08-21 10:33:20 -03:00
parent 0166fbdf6c
commit 3014494740
3 changed files with 82 additions and 12 deletions

View File

@ -30,9 +30,9 @@
{%- set uri = '%s/%s/releases/download/%s/%s'|format(p.pkg.uri, name, v.version, name) %}
{%- set url = '%s-%s.%s-%s.tar.gz'|format(uri, v.version|replace('v',''), p.kernel, p.arch) %}
{%- set dir = '%s-%s'|format(name, v.version) %}
{%- endif %}
{%- do p.pkg.component[name].update({'path': p.dir.archive ~ '/' + dir }) %}
{%- do p.pkg.component[name]['archive'].update({'name': p.dir.archive + '/' + dir, 'source': url}) %}
{%- endif %}
{%- endfor %}
{%- endif %}

View File

@ -25,14 +25,73 @@ Debian:
- cron
use_upstream_repo: false
use_upstream_package: false
use_upstream_archive: true
repo:
humanname: 'prometheus repository'
key_url: 'https://s3-eu-west-1.amazonaws.com/deb.robustperception.io/41EFC99D.gpg'
file: /etc/apt/sources.list.d/prometheus.list
use_upstream_archive: false
component:
prometheus:
name: prometheus
alertmanager:
name: prometheus-alertmanager
apache_exporter:
name: prometheus-apache-exporter
bind_exporter:
name: prometheus-bind-exporter
bird_exporter:
name: prometheus-bird-exporter
blackbox_exporter:
name: prometheus-blackbox-exporter
hacluster_exporter:
name: prometheus-hacluster-exporter
haproxy_exporter:
name: prometheus-haproxy-exporter
homeplug_exporter:
name: prometheus-homeplug-exporter
ipmi_exporter:
name: prometheus-ipmi-exporter
libvirt_exporter:
name: prometheus-libvirt-exporter
mailexporter:
name: prometheus-mailexporter
mongodb_exporter:
name: prometheus-mongodb-exporter
mysqld_exporter:
name: prometheus-mysqld-exporter
nginx_exporter:
name: prometheus-nginx-exporter
nginx_vts_exporter:
name: prometheus-nginx-vts-exporter
node_exporter:
name: prometheus-node-exporter
args_file: /etc/default/prometheus-node-exporter
node_exporter_collectors:
name: prometheus-node-exporter-collectors
openstack_exporter:
name: prometheus-openstack-exporter
pgbouncer_exporter:
name: prometheus-pgbouncer-exporter
postfix_exporter:
name: prometheus-postfix-exporter
postgres_exporter:
name: prometheus-postgres-exporter
process_exporter:
name: prometheus-process-exporter
pushgateway:
name: prometheus-pushgateway
snmp_exporter:
name: prometheus-snmp-exporter
sql_exporter:
name: prometheus-sql-exporter
squid_exporter:
name: prometheus-squid-exporter
tplink_plug_exporter:
name: prometheus-tplink-plug-exporter
trafficserver_exporter:
name: prometheus-trafficserver-exporter
varnish_exporter:
name: prometheus-varnish-exporter
xmpp_alerts:
name: prometheus-xmpp-alerts
exporters:
node_exporter:
textfile_collectors_dependencies:

View File

@ -1,11 +1,13 @@
# -*- coding: utf-8 -*-
# vim: ft=sls
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- if grains.os_family == 'RedHat' %}
{%- if p.pkg.use_upstream_repo and 'repo' in p.pkg and p.pkg.repo %}
{%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
{%- if p.pkg.use_upstream_repo and 'repo' in p.pkg and p.pkg.repo %}
{%- from tplroot ~ "/files/macros.jinja" import format_kwargs with context %}
prometheus-package-repo-install-pkgrepo-managed:
pkgrepo.managed:
@ -16,6 +18,15 @@ prometheus-package-repo-install-pkgrepo-managed:
- pattern: ' gpgkey2='
- repl: '\n '
- ignore_if_missing: True
- onlyif: {{ grains.os_family == 'RedHat' }}
{%- endif %}
{%- endif %}
{%- else %}
prometheus-package-repo-install-pkgrepo-managed:
test.show_notification:
- name: Skipping repository configuration
- text: |
At the moment, there's no repo for {{ grains['os'] }}
See https://prometheus.io/download/
{%- endif %}