From 364f63ddb1c96f7e98a1fe7bb85c3af9ab5ac2e1 Mon Sep 17 00:00:00 2001 From: Sergei Antipov Date: Thu, 22 Sep 2016 16:04:09 +0700 Subject: [PATCH] Added possibility to configure extra flags --- defaults/main.yml | 2 ++ templates/etc/systemd/system/prometheus.service.j2 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index d9c5919..4586d75 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -43,3 +43,5 @@ prometheus_config_flags: 'web.external-url': '{{ prometheus_web_external_url }}' 'alertmanager.url': '{{ prometheus_alertmanager_url }}' +prometheus_config_flags_extra: {} + diff --git a/templates/etc/systemd/system/prometheus.service.j2 b/templates/etc/systemd/system/prometheus.service.j2 index f28edee..9d06ad9 100644 --- a/templates/etc/systemd/system/prometheus.service.j2 +++ b/templates/etc/systemd/system/prometheus.service.j2 @@ -9,7 +9,7 @@ PIDFile={{ prometheus_pid_path }} User={{ prometheus_user }} Group={{ prometheus_group }} ExecReload=/bin/kill -HUP $MAINPID -ExecStart={{ prometheus_bin_dir }}/prometheus {% for flag, flag_value in prometheus_config_flags.iteritems() %}-{{ flag }}={{ flag_value }} {% endfor %} +ExecStart={{ prometheus_bin_dir }}/prometheus {% for flag, flag_value in prometheus_config_flags.iteritems() %}-{{ flag }}={{ flag_value }} {% endfor %}{% for flag, flag_value in prometheus_config_flags_extra.iteritems() %}-{{ flag }}={{ flag_value }} {% endfor %} SyslogIdentifier=prometheus Restart=always