mesaguy / ansible-prometheus

Ansible role for the management of Prometheus software and Prometheus exporters
https://galaxy.ansible.com/mesaguy/prometheus
MIT License
71 stars 31 forks source link

prometheus_node_exporter_textfiles_directory undefined #25

Closed shaunrampersad closed 3 years ago

shaunrampersad commented 4 years ago

Hi

Version: v0.12.22

Hitting an issue with a variable being undefined.

The error was: 'prometheus_node_exporter_textfiles_directory' is undefined
The error appears to be in '../roles/mesaguy.prometheus/tasks/main.yml': line 2, column 3,

Docs describe the variables purpose, but there is no default set for it.


    prometheus_node_exporter_textfiles_directory: '/opt/prometheus/etc/node_exporter_textfiles'

Maybe this needs to be added to defaults?

mesaguy commented 3 years ago

Confirmed, fixed with 7bd4036f7dd5c8178b234706241a359c79580ce0

f9n commented 3 years ago

Same on v0.12.25

fatal: [default]: FAILED! => {"msg": "The task includes an option with an undefined variable. The error was: 'prometheus_node_exporter_textfiles_directory' is undefined\n\nThe error appears to be in '/home/packer/.ansible/roles/mesaguy.prometheus/tasks/main.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: Set global facts to be used inside and outside of role\n  ^ here\n"}

My usage:

    - role: mesaguy.prometheus
      vars:
        prometheus_manage_client_tgroups: false
        prometheus_components:
          - node_exporter
dbolotin commented 3 years ago

I confirm, the same error with:

prometheus_host: 10.43.15.1
prometheus_alertmanager_host: 10.43.15.1

prometheus_extra_opts:
  - '--storage.tsdb.retention=1y'

prometheus_components:
  - prometheus
  - alertmanager

on the latest release version (v0.12.25)