move defaults vars to defaults directory
This commit is contained in:
parent
d94fefc0e3
commit
925f1a762d
@ -1 +1,20 @@
|
||||
---
|
||||
awh_services_docker_pull: "no"
|
||||
|
||||
prometheus_exporter_packages: []
|
||||
|
||||
prometheus_mongodb_exporter_database: "database"
|
||||
prometheus_mongodb_exporter_host: "localhost"
|
||||
prometheus_mongodb_exporter_port: 27017
|
||||
|
||||
prometheus_postgres_exporter_host: "/var/run/postgresql/"
|
||||
prometheus_postgres_exporter_sslmode: "disable"
|
||||
prometheus_postgres_exporter_user: "postgres"
|
||||
|
||||
prometheus_server_enable: false
|
||||
prometheus_server_global_evaluation_interval: 15
|
||||
prometheus_server_global_scrape_interval: 15
|
||||
prometheus_server_job_name: "prometheus"
|
||||
prometheus_server_scrape_interval: 5
|
||||
prometheus_server_scrape_timeout: 5
|
||||
prometheus_server_version: "latest"
|
||||
|
@ -43,7 +43,7 @@
|
||||
docker_container:
|
||||
name: prometheus
|
||||
hostname: '{{ inventory_hostname }}'
|
||||
image: prom/prometheus:{{ prometheus_server_version|default("latest") }}
|
||||
image: prom/prometheus:{{ prometheus_server_version }}
|
||||
volumes:
|
||||
- /etc/prometheus/:/etc/prometheus/
|
||||
- prometheus_data:/prometheus
|
||||
@ -61,7 +61,7 @@
|
||||
log_options:
|
||||
tag: docker_prometheus
|
||||
restart_policy: 'unless-stopped'
|
||||
pull: '{{ awh_services_docker_pull|default("no") }}'
|
||||
pull: '{{ awh_services_docker_pull }}'
|
||||
tags:
|
||||
- prometheus
|
||||
notify:
|
||||
|
@ -1,6 +1,6 @@
|
||||
# {{ ansible_managed }}
|
||||
{% if (prometheus_mongodb_exporter_user is defined) and (prometheus_mongodb_exporter_pass is defined) %}
|
||||
MONGODB_URI=mongodb://{{ prometheus_mongodb_exporter_user }}:{{ prometheus_mongodb_exporter_pass }}@{{ prometheus_mongodb_exporter_host|default("localhost") }}:{{ prometheus_mongodb_exporter_port|default("27017") }}/{{ prometheus_mongodb_exporter_database|default("admin") }}
|
||||
MONGODB_URI=mongodb://{{ prometheus_mongodb_exporter_user }}:{{ prometheus_mongodb_exporter_pass }}@{{ prometheus_mongodb_exporter_host }}:{{ prometheus_mongodb_exporter_port }}/{{ prometheus_mongodb_exporter_database }}
|
||||
{% else %}
|
||||
MONGODB_URI=mongodb://{{ prometheus_mongodb_exporter_host|default("localhost") }}:{{ prometheus_mongodb_exporter_port|default("27017") }}/{{ prometheus_mongodb_exporter_database|default("admin") }}
|
||||
MONGODB_URI=mongodb://{{ prometheus_mongodb_exporter_host }}:{{ prometheus_mongodb_exporter_port }}/{{ prometheus_mongodb_exporter_database }}
|
||||
{% endif %}
|
||||
|
@ -1,2 +1,2 @@
|
||||
# {{ ansible_managed }}
|
||||
DATA_SOURCE_NAME="user={{ prometheus_postgres_exporter_user|default("postgres") }} host={{ prometheus_postgres_exporter_host|default("/var/run/postgresql/") }} sslmode={{ prometheus_postgres_exporter_sslmode|default("disable") }}"
|
||||
DATA_SOURCE_NAME="user={{ prometheus_postgres_exporter_user }} host={{ prometheus_postgres_exporter_host }} sslmode={{ prometheus_postgres_exporter_sslmode }}"
|
||||
|
@ -1,8 +1,8 @@
|
||||
# {{ ansible_managed }}
|
||||
|
||||
global:
|
||||
scrape_interval: {{ prometheus_server_global_scrape_interval | default(15) }}s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
||||
evaluation_interval: {{ prometheus_server_global_evaluation_interval | default(15) }}s # Evaluate rules every 15 seconds. The default is every 1 minute.
|
||||
scrape_interval: {{ prometheus_server_global_scrape_interval }}s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
|
||||
evaluation_interval: {{ prometheus_server_global_evaluation_interval }}s # Evaluate rules every 15 seconds. The default is every 1 minute.
|
||||
|
||||
# Attach these labels to any time series or alerts when communicating with
|
||||
# external systems (federation, remote storage, Alertmanager).
|
||||
@ -19,11 +19,11 @@ rule_files:
|
||||
# Here it's Prometheus itself.
|
||||
scrape_configs:
|
||||
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
|
||||
- job_name: '{{ prometheus_server_job_name | default("prometheus") }}'
|
||||
- job_name: '{{ prometheus_server_job_name }}'
|
||||
|
||||
# Override the global default and scrape targets from this job every 5 seconds.
|
||||
scrape_interval: {{ prometheus_server_scrape_interval | default(5) }}s
|
||||
scrape_timeout: {{ prometheus_server_scrape_timeout | default(5) }}s
|
||||
scrape_interval: {{ prometheus_server_scrape_interval }}s
|
||||
scrape_timeout: {{ prometheus_server_scrape_timeout }}s
|
||||
|
||||
# metrics_path defaults to '/metrics'
|
||||
# scheme defaults to 'http'.
|
||||
|
@ -4,7 +4,7 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User={{ prometheus_postgres_exporter_user|default("postgres") }}
|
||||
User={{ prometheus_postgres_exporter_user }}
|
||||
ExecStart=/usr/local/bin/prometheus-postgres-exporter
|
||||
EnvironmentFile=/etc/default/prometheus-postgres-exporter
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user