Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version comparison logic used for downloading node exporter binary fails on Ansible 2.9 #44

Open
dgptamayo opened this issue Jan 3, 2020 · 2 comments

Comments

@dgptamayo
Copy link

dgptamayo commented Jan 3, 2020

The download task fails with this error:

TASK [UnderGreen.prometheus-node-exporter : download prometheus node exporter binary] *********************************************************************** task path: /home/ansible/roles/UnderGreen.prometheus-node-exporter/tasks/main.yml:3 fatal: [server]: FAILED! => { "msg": "An unhandled exception occurred while templating '{% if prometheus_node_exporter_version | version_compare('0.13.0', '>=') %}https://github.com/prometheus/node_exporter/releases/download/v{{ prometheus_node_exporter_version }}/{{ prometheus_node_exporter_release_name }}.tar.gz{% else %}https://github.com/prometheus/node_exporter/releases/download/{{ prometheus_node_exporter_version }}/{{ prometheus_node_exporter_release_name }}.tar.gz{% endif %}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: template error while templating string: no filter named 'version_compare'. String: {% if prometheus_node_exporter_version | version_compare('0.13.0', '>=') %}https://github.com/prometheus/node_exporter/releases/download/v{{ prometheus_node_exporter_version }}/{{ prometheus_node_exporter_release_name }}.tar.gz{% else %}https://github.com/prometheus/node_exporter/releases/download/{{ prometheus_node_exporter_version }}/{{ prometheus_node_exporter_release_name }}.tar.gz{% endif %}" }

Seems like version_compare filter has been deprecated in Ansible 2.9

@dgptamayo dgptamayo changed the title Version comparison logic used for downloading node exported binary fails on Ansible 2.9 Version comparison logic used for downloading node exporter binary fails on Ansible 2.9 Jan 3, 2020
@ChrisHirsch
Copy link

I had a fix for this only to discover it's already been patched. Apparently if you download via ansible-galaxy it's picking up an older version?

@upgradeksh
Copy link

I am encountering this issue :(
Does Ansible Galaxy need the new latest tag with v1.5.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants