Compare commits
1 Commits
libertacas
...
pre-commit
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2659519af6 |
@ -30,7 +30,7 @@ repos:
|
|||||||
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
|
additional_dependencies: ['@commitlint/config-conventional@8.3.4']
|
||||||
always_run: true
|
always_run: true
|
||||||
- repo: https://github.com/rubocop-hq/rubocop
|
- repo: https://github.com/rubocop-hq/rubocop
|
||||||
rev: v1.30.1
|
rev: v1.42.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: rubocop
|
- id: rubocop
|
||||||
name: Check Ruby files with rubocop
|
name: Check Ruby files with rubocop
|
||||||
@ -38,14 +38,14 @@ repos:
|
|||||||
always_run: true
|
always_run: true
|
||||||
pass_filenames: false
|
pass_filenames: false
|
||||||
- repo: https://github.com/shellcheck-py/shellcheck-py
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||||
rev: v0.8.0.4
|
rev: v0.9.0.2
|
||||||
hooks:
|
hooks:
|
||||||
- id: shellcheck
|
- id: shellcheck
|
||||||
name: Check shell scripts with shellcheck
|
name: Check shell scripts with shellcheck
|
||||||
files: ^.*\.(sh|bash|ksh)$
|
files: ^.*\.(sh|bash|ksh)$
|
||||||
types: []
|
types: []
|
||||||
- repo: https://github.com/adrienverge/yamllint
|
- repo: https://github.com/adrienverge/yamllint
|
||||||
rev: v1.26.3
|
rev: v1.28.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
name: Check YAML syntax with yamllint
|
name: Check YAML syntax with yamllint
|
||||||
@ -58,8 +58,8 @@ repos:
|
|||||||
- id: salt-lint
|
- id: salt-lint
|
||||||
name: Check Salt files using salt-lint
|
name: Check Salt files using salt-lint
|
||||||
files: ^.*\.(sls|jinja|j2|tmpl|tst)$
|
files: ^.*\.(sls|jinja|j2|tmpl|tst)$
|
||||||
- repo: https://github.com/myint/rstcheck
|
- repo: https://github.com/rstcheck/rstcheck
|
||||||
rev: 3f929574
|
rev: v6.1.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: rstcheck
|
- id: rstcheck
|
||||||
name: Check reST files using rstcheck
|
name: Check reST files using rstcheck
|
||||||
|
@ -40,19 +40,15 @@ prometheus-config-file-{{ name }}-file-managed:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
{%- if grains.os != 'Windows' %}
|
{%- if grains.os != 'Windows' %}
|
||||||
- mode: 644
|
- mode: 644
|
||||||
{%- if p.manage_user_group %}
|
|
||||||
- user: {{ name }}
|
- user: {{ name }}
|
||||||
- group: {{ name }}
|
- group: {{ name }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
|
||||||
- context:
|
- context:
|
||||||
config: {{ p.pkg.component[name]['config']|json }}
|
config: {{ p.pkg.component[name]['config']|json }}
|
||||||
- require:
|
- require:
|
||||||
- file: prometheus-config-file-etc-file-directory
|
- file: prometheus-config-file-etc-file-directory
|
||||||
{%- if p.manage_user_group %}
|
|
||||||
- user: prometheus-config-users-install-{{ name }}-user-present
|
- user: prometheus-config-users-install-{{ name }}-user-present
|
||||||
- group: prometheus-config-users-install-{{ name }}-group-present
|
- group: prometheus-config-users-install-{{ name }}-group-present
|
||||||
{%- endif %}
|
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: prometheus-service-running-{{ name }}
|
- service: prometheus-service-running-{{ name }}
|
||||||
|
|
||||||
@ -75,19 +71,15 @@ prometheus-config-file-{{ ef }}-file-managed:
|
|||||||
- template: jinja
|
- template: jinja
|
||||||
{%- if grains.os != 'Windows' %}
|
{%- if grains.os != 'Windows' %}
|
||||||
- mode: 644
|
- mode: 644
|
||||||
{%- if p.manage_user_group %}
|
|
||||||
- user: {{ component }}
|
- user: {{ component }}
|
||||||
- group: {{ component }}
|
- group: {{ component }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- endif %}
|
|
||||||
- context:
|
- context:
|
||||||
config: {{ p.extra_files[ef]['config'] }}
|
config: {{ p.extra_files[ef]['config'] }}
|
||||||
- require:
|
- require:
|
||||||
- file: prometheus-config-file-etc-file-directory
|
- file: prometheus-config-file-etc-file-directory
|
||||||
{%- if p.manage_user_group %}
|
|
||||||
- user: prometheus-config-users-install-{{ component }}-user-present
|
- user: prometheus-config-users-install-{{ component }}-user-present
|
||||||
- group: prometheus-config-users-install-{{ component }}-group-present
|
- group: prometheus-config-users-install-{{ component }}-group-present
|
||||||
{%- endif %}
|
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: prometheus-service-running-{{ component }}
|
- service: prometheus-service-running-{{ component }}
|
||||||
|
|
||||||
|
@ -24,11 +24,9 @@ prometheus-service-args-{{ name }}-data-dir:
|
|||||||
- makedirs: True
|
- makedirs: True
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: prometheus-service-running-{{ name }}
|
- service: prometheus-service-running-{{ name }}
|
||||||
{%- if p.manage_user_group %}
|
|
||||||
- require:
|
- require:
|
||||||
- user: prometheus-config-users-install-{{ name }}-user-present
|
- user: prometheus-config-users-install-{{ name }}-user-present
|
||||||
- group: prometheus-config-users-install-{{ name }}-group-present
|
- group: prometheus-config-users-install-{{ name }}-group-present
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
{%- set tplroot = tpldir.split('/')[0] %}
|
{%- set tplroot = tpldir.split('/')[0] %}
|
||||||
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
|
{%- from tplroot ~ "/map.jinja" import prometheus as p with context %}
|
||||||
|
|
||||||
{%- if p.manage_user_group or p.pkg.use_upstream_archive %}
|
|
||||||
{%- for name in p.wanted.component %}
|
{%- for name in p.wanted.component %}
|
||||||
|
|
||||||
prometheus-config-users-install-{{ name }}-group-present:
|
prometheus-config-users-install-{{ name }}-group-present:
|
||||||
@ -30,4 +29,3 @@ prometheus-config-users-install-{{ name }}-user-present:
|
|||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{%- endif %}
|
|
||||||
|
@ -23,8 +23,6 @@ prometheus:
|
|||||||
tmp: /tmp/prometheus
|
tmp: /tmp/prometheus
|
||||||
var: /var/lib/prometheus
|
var: /var/lib/prometheus
|
||||||
|
|
||||||
manage_user_group: true
|
|
||||||
|
|
||||||
pkg:
|
pkg:
|
||||||
uri: https://github.com/prometheus
|
uri: https://github.com/prometheus
|
||||||
use_upstream_repo: false
|
use_upstream_repo: false
|
||||||
|
@ -22,11 +22,9 @@ prometheus-exporters-{{ name }}-collector-textfile-dir:
|
|||||||
- group: {{ name }}
|
- group: {{ name }}
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
- makedirs: True
|
- makedirs: True
|
||||||
{%- if p.manage_user_group %}
|
|
||||||
- require:
|
- require:
|
||||||
- user: prometheus-config-users-install-{{ name }}-user-present
|
- user: prometheus-config-users-install-{{ name }}-user-present
|
||||||
- group: prometheus-config-users-install-{{ name }}-group-present
|
- group: prometheus-config-users-install-{{ name }}-group-present
|
||||||
{%- endif %}
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
||||||
{%- for k, v in p.get('exporters', {}).get(name, {}).get('textfile_collectors', {}).items() %}
|
{%- for k, v in p.get('exporters', {}).get(name, {}).get('textfile_collectors', {}).items() %}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
# File managed by Salt at <{{ source }}>.
|
# File managed by Salt at <{{ source }}>.
|
||||||
# Your changes may be overwritten.
|
# Your changes may be overwritten.
|
||||||
########################################################################
|
########################################################################
|
||||||
# Set the command-line arguments to pass to the server."
|
# Set the command-line arguments to pass to the server.%}"
|
||||||
{{ arg_name }}="{{ args }}"
|
{{ arg_name }}="{{ args }}"
|
||||||
|
|
||||||
|
|
||||||
|
@ -219,66 +219,7 @@ RedHat:
|
|||||||
sslcacert: /etc/pki/tls/certs/ca-bundle.crt
|
sslcacert: /etc/pki/tls/certs/ca-bundle.crt
|
||||||
metadata_expire: 300
|
metadata_expire: 300
|
||||||
|
|
||||||
Suse:
|
Suse: {}
|
||||||
manage_user_group: false
|
|
||||||
pkg:
|
|
||||||
use_upstream_repo: false
|
|
||||||
use_upstream_package: false
|
|
||||||
use_upstream_archive: false
|
|
||||||
component:
|
|
||||||
alertmanager:
|
|
||||||
name: golang-github-prometheus-alertmanager
|
|
||||||
service:
|
|
||||||
name: prometheus-alertmanager
|
|
||||||
environ_file: /etc/sysconfig/prometheus-alertmanager
|
|
||||||
args:
|
|
||||||
config.file: /etc/prometheus/alertmanager.yml
|
|
||||||
config_file: /etc/prometheus/alertmanager.yml
|
|
||||||
prometheus:
|
|
||||||
name: golang-github-prometheus-prometheus
|
|
||||||
service:
|
|
||||||
name: prometheus
|
|
||||||
environ_file: /etc/sysconfig/prometheus
|
|
||||||
environ:
|
|
||||||
environ_arg_name: ARGS
|
|
||||||
config_file: /etc/prometheus/prometheus.yml
|
|
||||||
blackbox_exporter:
|
|
||||||
name: prometheus-blackbox_exporter
|
|
||||||
config_file: /etc/prometheus/blackbox.yml
|
|
||||||
service:
|
|
||||||
name: prometheus-blackbox_exporter
|
|
||||||
hacluster_exporter:
|
|
||||||
name: prometheus-ha_cluster_exporter
|
|
||||||
environ_file: /etc/sysconfig/prometheus-ha_cluster_exporter
|
|
||||||
environ:
|
|
||||||
environ_arg_name: ARGS
|
|
||||||
service:
|
|
||||||
name: prometheus-ha_cluster_exporter
|
|
||||||
node_exporter:
|
|
||||||
name: golang-github-prometheus-node_exporter
|
|
||||||
service:
|
|
||||||
name: prometheus-node_exporter
|
|
||||||
environ_file: /etc/sysconfig/prometheus-node_exporter
|
|
||||||
environ:
|
|
||||||
environ_arg_name: ARGS
|
|
||||||
postgres_exporter:
|
|
||||||
name: prometheus-postgres_exporter
|
|
||||||
service:
|
|
||||||
name: prometheus-postgres_exporter
|
|
||||||
environ_file: /etc/sysconfig/prometheus-postgres_exporter
|
|
||||||
environ:
|
|
||||||
environ_arg_name: POSTGRES_EXPORTER_PARAMS
|
|
||||||
saptune_exporter:
|
|
||||||
name: prometheus-saptune_exporter
|
|
||||||
service:
|
|
||||||
name: prometheus-saptune_exporter
|
|
||||||
webhook_snmp:
|
|
||||||
name: prometheus-webhook-snmp
|
|
||||||
service:
|
|
||||||
name: prometheus-webhook-snmp
|
|
||||||
environ_file: /etc/default/prometheus-webhook-snmp
|
|
||||||
environ:
|
|
||||||
environ_arg_name: PROMETHEUS_WEBHOOK_SNMP_OPTIONS
|
|
||||||
|
|
||||||
Gentoo:
|
Gentoo:
|
||||||
pkg:
|
pkg:
|
||||||
|
@ -30,11 +30,9 @@ prometheus-service-args-{{ name }}-data-dir:
|
|||||||
- makedirs: True
|
- makedirs: True
|
||||||
- watch_in:
|
- watch_in:
|
||||||
- service: prometheus-service-running-{{ name }}
|
- service: prometheus-service-running-{{ name }}
|
||||||
{%- if p.manage_user_group %}
|
|
||||||
- require:
|
- require:
|
||||||
- user: prometheus-config-users-install-{{ name }}-user-present
|
- user: prometheus-config-users-install-{{ name }}-user-present
|
||||||
- group: prometheus-config-users-install-{{ name }}-group-present
|
- group: prometheus-config-users-install-{{ name }}-group-present
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
{%- if grains.os_family == 'FreeBSD' %}
|
{%- if grains.os_family == 'FreeBSD' %}
|
||||||
|
@ -13,12 +13,6 @@ prometheus:
|
|||||||
- alertmanager
|
- alertmanager
|
||||||
- node_exporter
|
- node_exporter
|
||||||
- blackbox_exporter
|
- blackbox_exporter
|
||||||
{%- if grains.os == 'SUSE' %}
|
|
||||||
- hacluster_exporter
|
|
||||||
- postgres_exporter
|
|
||||||
- saptune_exporter
|
|
||||||
- webhook_snmp
|
|
||||||
{%- endif %}
|
|
||||||
|
|
||||||
exporters:
|
exporters:
|
||||||
node_exporter:
|
node_exporter:
|
||||||
@ -37,7 +31,7 @@ prometheus:
|
|||||||
|
|
||||||
pkg:
|
pkg:
|
||||||
# yamllint disable-line rule:braces rule:commas
|
# yamllint disable-line rule:braces rule:commas
|
||||||
use_upstream_repo: {{ false if grains.os_family|lower in ('debian','suse',) else true }}
|
use_upstream_repo: {{ false if grains.os_family|lower in ('debian',) else true }}
|
||||||
use_upstream_archive: false
|
use_upstream_archive: false
|
||||||
|
|
||||||
clientlibs:
|
clientlibs:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user