2023-02-21 18:31:19 +00:00
---
2023-03-08 08:15:06 +01:00
# yamllint disable rule:line-length
2023-02-21 18:31:19 +00:00
argument_specs :
main :
short_description : "Installs and configures prometheus"
description :
- "Prometheus monitoring system configuration and management"
author :
- "Prometheus Community"
options :
prometheus_version :
description :
- "Prometheus package version. Also accepts C(latest) as parameter."
- "Only prometheus 2.x is supported"
2023-07-25 17:43:41 +02:00
default : "2.46.0"
2023-02-21 18:31:19 +00:00
prometheus_skip_install :
description : "Prometheus installation tasks gets skipped when set to true."
type : bool
default : false
prometheus_binary_local_dir :
description :
- "Allows to use local packages instead of ones distributed on github."
- "As parameter it takes a directory where I(prometheus) AND I(promtool) binaries are stored on host on which ansible is ran."
- "This overrides I(prometheus_version) parameter"
2023-03-06 21:05:03 +00:00
prometheus_binary_url :
description : "URL of the prometheus binaries .tar.gz file"
2023-03-12 16:48:29 +01:00
default : "https://github.com/{{ _prometheus_repo }}/releases/download/v{{ prometheus_version }}/ prometheus-{{ prometheus_version }}.linux-{{ go_arch }}.tar.gz"
2023-03-06 21:05:03 +00:00
prometheus_checksums_url :
description : URL of the prometheus checksums file
2023-03-12 16:48:29 +01:00
default : "https://github.com/{{ _prometheus_repo }}/releases/download/v{{ prometheus_version }}/sha256sums.txt"
2023-02-21 18:31:19 +00:00
prometheus_config_dir :
description : "Path to directory with prometheus configuration"
default : "/etc/prometheus"
prometheus_db_dir :
description : "Path to directory with prometheus database"
default : "/var/lib/prometheus"
prometheus_read_only_dirs :
description : "Additional paths that Prometheus is allowed to read (useful for SSL certs outside of the config directory)"
type : "list"
elements : "str"
prometheus_web_listen_address :
description : "Address on which prometheus will be listening"
default : "0.0.0.0:9090"
prometheus_web_config :
2023-03-08 08:15:06 +01:00
description : "A Prometheus L(web config yaml,https://github.com/prometheus/exporter-toolkit/blob/master/docs/web-configuration.md) for configuring TLS and auth."
2023-02-21 18:31:19 +00:00
type : "dict"
prometheus_web_external_url :
description : "External address on which prometheus is available. Useful when behind reverse proxy. Ex. `http://example.org/prometheus`"
2023-03-06 16:45:07 +00:00
prometheus_metrics_path :
description : "Prometheus external metrics path"
2023-03-06 21:05:03 +00:00
default : "/{{ (prometheus_web_external_url + '/metrics') | regex_replace('^(.*://)?(.*?)/') }}"
2023-02-21 18:31:19 +00:00
prometheus_storage_retention :
2023-03-06 21:05:03 +00:00
description :
- "Data retention period"
2023-02-21 18:31:19 +00:00
default : "30d"
prometheus_storage_retention_size :
2023-03-06 17:35:46 +00:00
description :
- "Data retention period by size"
- "Maximum number of bytes that can be stored for blocks."
- "Units supported: KB, MB, GB, TB, PB."
default : "0"
2023-02-21 18:31:19 +00:00
prometheus_config_flags_extra :
2023-03-06 21:05:03 +00:00
description :
- "Additional configuration flags passed to prometheus binary at startup"
- "Example: prometheus_config_flags_extra: { storage.tsdb.retention: 15d, alertmanager.timeout: 10s }"
2023-02-21 18:31:19 +00:00
type : "dict"
prometheus_alertmanager_config :
description :
- "Configuration responsible for pointing where alertmanagers are. This should be specified as list in yaml format."
2023-03-08 08:15:06 +01:00
- "It is compatible with the official L(alertmanager_config,https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alertmanager_config)"
2023-02-21 18:31:19 +00:00
type : "list"
elements : "str"
prometheus_alert_relabel_configs :
description :
- "Alert relabeling rules. This should be specified as list in yaml format."
2023-03-08 08:15:06 +01:00
- "It is compatible with the official L(alert_relabel_configs,https://prometheus.io/docs/prometheus/latest/configuration/configuration/#alert_relabel_configs)"
2023-02-21 18:31:19 +00:00
type : "list"
elements : "str"
prometheus_global :
description :
2023-03-08 08:15:06 +01:00
- "Prometheus global config. It is compatible with the L(official configuration,https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration-file)"
2023-02-21 18:31:19 +00:00
type : "dict"
default :
scrape_interval : "60s"
scrape_timeout : "15s"
evaluation_interval : "15s"
prometheus_remote_write :
description :
2023-03-08 08:15:06 +01:00
- "Remote write. Compatible with the L(official configuration,https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write)"
2023-02-21 18:31:19 +00:00
type : "list"
elements : "str"
prometheus_remote_read :
description :
2023-03-08 08:15:06 +01:00
- "Remote read. It is compatible with the L(official configuration,https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_read)"
2023-02-21 18:31:19 +00:00
type : "list"
elements : "str"
prometheus_external_labels :
description : "Provide map of additional labels which will be added to any time series or alerts when communicating with external systems"
type : "dict"
default :
environment : "{{ ansible_fqdn | default(ansible_host) | default(inventory_hostname) }}"
prometheus_targets :
description :
2023-03-05 11:11:13 +01:00
- "Targets which will be scraped."
2023-02-21 18:31:19 +00:00
type : "dict"
prometheus_scrape_configs :
description :
2023-03-08 08:15:06 +01:00
- "Prometheus scrape jobs provided in same format as in the L(official docs,https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config)"
2023-02-21 18:31:19 +00:00
type : "list"
elements : "dict"
default :
- job_name : "prometheus"
metrics_path : "{{ prometheus_metrics_path }}"
static_configs :
- targets :
- "{{ ansible_fqdn | default(ansible_host) | default('localhost') }}:9090"
- job_name : "node"
file_sd_configs :
- files :
- "{{ prometheus_config_dir }}/file_sd/node.yml"
prometheus_config_file :
description : "Variable used to provide custom prometheus configuration file in form of ansible template"
default : "prometheus.yml.j2"
prometheus_alert_rules :
description :
- "Full list of alerting rules which will be copied to C({{ prometheus_config_dir }}/rules/ansible_managed.rules)."
- "Alerting rules can be also provided by other files located in C({{ prometheus_config_dir }}/rules/) which have C(*.rules) extension"
- "Please see default values in role defaults/main.yml"
type : "list"
elements : "dict"
prometheus_alert_rules_files :
description :
- "List of folders where ansible will look for files containing alerting rules which will be copied to C({{ prometheus_config_dir }}/rules/)."
- "Files must have C(*.rules) extension"
type : "list"
elements : "str"
default :
- "prometheus/rules/*.rules"
prometheus_static_targets_files :
description :
2023-03-08 08:15:06 +01:00
- "List of folders where ansible will look for files containing custom static target configuration files which will be copied to C({{ prometheus_config_dir }}/file_sd/)."
2023-02-21 18:31:19 +00:00
type : "list"
elements : "str"
default :
- "prometheus/targets/*.yml"
- "prometheus/targets/*.json"