diff --git a/defaults/main.yml b/defaults/main.yml index 244e2cf..4899b0e 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -14,6 +14,8 @@ prometheus_postgres_exporter_host: "/var/run/postgresql/" prometheus_postgres_exporter_sslmode: "disable" prometheus_postgres_exporter_user: "postgres" +prometheus_retention_time: "15d" + prometheus_server_enable: false prometheus_server_global_evaluation_interval: 15 prometheus_server_global_scrape_interval: 15 diff --git a/tasks/prometheus.yml b/tasks/prometheus.yml index ce8e69b..fb8ceae 100644 --- a/tasks/prometheus.yml +++ b/tasks/prometheus.yml @@ -50,6 +50,7 @@ command: - '--config.file=/etc/prometheus/prometheus.yml' - '--storage.tsdb.path=/prometheus' + - '--storage.tsdb.retention.time={{ prometheus_retention_time }}' - '--web.console.libraries=/usr/share/prometheus/console_libraries' - '--web.console.templates=/usr/share/prometheus/consoles' - '--web.enable-admin-api'