mesaguy / ansible-prometheus

Ansible role for the management of Prometheus software and Prometheus exporters

Home Page:https://galaxy.ansible.com/mesaguy/prometheus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

when my input path and patterns_dir set ok. grok_exporter_fstab ansible error.

linjianzao opened this issue · comments

when my input path and patterns_dir set ok. grok_exporter_fstab ansible error, but service grok_exporter_fstab staus is running.

---
- name: install prometheus grok_exporter
  hosts: prometheusserver
  vars:
    prometheus_link_etc: false
    prometheus_software_src_dir_suffix: grok_exporter
    prometheus_grok_exporter_fstab_cfg: '{{ lookup("file", "./files/grok_exporter_fstab/grok_exporter_fstab.yml") }}'
    prometheus_components:
     - grok_exporter_fstab

  roles:
    - mesaguy.prometheus
---
global:
    config_version: 2
input:
    type: file
    path: /opt/prometheus/exporters/grok_exporter_fstab/active/example/example.log
    readall: true
grok:
    #patterns_dir: ./logstash-patterns-core/patterns
    patterns_dir: /opt/prometheus/exporters/grok_exporter_fstab/active/patterns
metrics:
    - type: counter
      name: grok_example_lines_total
      help: Counter metric example with labels.
      match: '%{DATE} %{TIME} %{USER:user} %{NUMBER}'
      labels:
          user: '{{.user}}'
server:
    port: 9144

fatal: [host1]: FAILED! => {"msg": "The conditional check 'prometheus_servers' failed. The error was: error while evaluating conditional (prometheus_servers): 'prometheus_servers' is undefined\n\nThe error appears to have been in '/root/devops/roles/mesaguy.prometheus/tasks/_service.yml': line 48, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n- block:\n - name: Set {{ prometheus_software_name_version }} tgroup facts\n ^ here\nWe could be wrong, but this one looks like it might be an issue with\nmissing quotes. Always quote template expression brackets when they\nstart a value. For instance:\n\n with_items:\n - {{ foo }}\n\nShould be written as:\n\n with_items:\n - "{{ foo }}"\n"}

I apologize for the extremely late feedback. This issue has been fixed with the following commit which will be included in the next minor release in one or two weeks.