ansible-community / ansible-nomad

:watch: Ansible role for Nomad
https://galaxy.ansible.com/brianshumate/nomad
BSD 2-Clause "Simplified" License
294 stars 163 forks source link

Compatibility with the version 1.0.0 #114

Closed msirovy closed 3 years ago

msirovy commented 3 years ago

I have a fix for this, could you allow me to send it as a new branch?

This is how does the fix look like:

+{% if nomad_version | replace(".", "0000") | int >= 10000000000 %}
+    # Deprecated in 1.0.0
+    backwards_compatible_metrics = "{{ nomad_telemetry_backwards_compatible_metrics | default(false) | bool | lower }}"
+    disable_tagged_metrics = "{{ nomad_telemetry_disable_tagged_metrics | default(false) | bool | lower }}"
+{% endif %}
rndmh3ro commented 3 years ago

Hey @msirovy,

you might want to check out https://gist.github.com/Chaser324/ce0505fbed06b947d962 how to create a fork of this repo and create a PR.

As to the content: You can compare versions in Ansible with version_compare: https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html#comparing-versions

bbaassssiiee commented 3 years ago

In 2.5 version_compare was renamed to version

lanefu commented 3 years ago

Looks to be resolved by https://github.com/ansible-community/ansible-nomad/pull/115

but... sounds like a revision of how version_compare is done should be revised?