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

when condition fails when already installed #21

Closed iridian-ks closed 4 years ago

iridian-ks commented 4 years ago

The play is failing on the when condition of prometheus_software_installation is succeeded

To prevent that piece of code being executed and causing a failure another precondition in front of that can help.

iridian-ks commented 4 years ago

Actually, I'm not sure what's going on here. I'm actually installing a new exporter to test and getting this:

    "msg": "The conditional check 'prometheus_software_installation is succeeded' failed. The error was: The 'failed' test expects a dictionary\n\nThe error appears to be in '/workspace/roles/mesaguy.prometheus/tasks/_install_from_binary.yml': line 179, 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: Remove {{ prometheus_software_name_version }} archive file\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"
iridian-ks commented 4 years ago

Never mind, I was trying to disable building from source, which wasn't clear why it was doing that in the first place. Turns out process exporter can't pull from binaries in 0.6.0+. I had set this variable to True to disable building from source but turns out it was used here as well. My bad.