diff --git a/tasks/setup.yml b/tasks/setup.yml index 74ae8a4..4ebac3b 100644 --- a/tasks/setup.yml +++ b/tasks/setup.yml @@ -33,9 +33,9 @@ - prometheus-{{ prometheus_version }}.linux-amd64/NOTICE - prometheus-{{ prometheus_version }}.linux-amd64/prometheus.yml notify: __prometheus_restart + when: prometheus_version is version(prometheus_current_version, ">") or prometheus_current_version is version('0.0.0', "=") become: True become_user: "{{ prometheus_user }}" - when: prometheus_version is version(prometheus_current_version, ">") or prometheus_current_version is version('0.0.0', "=") - block: - name: Copy prometheus config file diff --git a/templates/conf/prometheus.yml.j2 b/templates/conf/prometheus.yml.j2 index 1be1e02..fb7d1a8 100644 --- a/templates/conf/prometheus.yml.j2 +++ b/templates/conf/prometheus.yml.j2 @@ -22,12 +22,12 @@ rule_files: alerting: alertmanagers: - {{ prometheus_alertmanager_config | to_nice_yaml(indent=2) | indent(2,False) }} + {{ prometheus_alertmanager_config | to_nice_yaml(indent=2) | indent(2, False) }} {% if prometheus_alert_relabel_configs | length > 0 %} alert_relabel_configs: - {{ prometheus_alert_relabel_configs | to_nice_yaml(indent=2) | indent(2,False) }} + {{ prometheus_alert_relabel_configs | to_nice_yaml(indent=2) | indent(2, False) }} {% endif %} {% endif %} scrape_configs: - {{ prometheus_scrape_configs | to_nice_yaml(indent=2) | indent(2,False) }} + {{ prometheus_scrape_configs | to_nice_yaml(indent=2) | indent(2, False) }}