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_compare appears to be removed in Ansible 2.9.2 #13

Open
dcrearer opened this issue Mar 7, 2020 · 1 comment
Open

version_compare appears to be removed in Ansible 2.9.2 #13

dcrearer opened this issue Mar 7, 2020 · 1 comment

Comments

@dcrearer
Copy link

dcrearer commented Mar 7, 2020

➜ ~ ansible --version
ansible 2.9.2

fatal: [sw4.eos]: FAILED! => {"changed": false, "msg": "template error while templating string: no filter named 'version_compare'. String: ! templates/varp_mac_addr.j2\n#jinja2: trim_blocks: False\n#jinja2: lstrip_blocks: False\n\n{# From EOS 4.17 and up, removing the ip virtual-router mac-address #}\n{# is done by setting the addr to 00:00:00:00:00:00. We need to check #}\n{# the version and process the removal of the mac addr appropriately #}\n{% set version = _eos_config | re_search("! device: .\(., EOS-(.*)\)$") %}\n{% set eos_417_up = version.group(1) | version_compare("4.17", ">=") %}\n\n{% if virtual_mac_addr %}\n\nip virtual-router mac-address {{ virtual_mac_addr }}\n\n{% else %}\n {% if eos_417_up %}\n\nip virtual-router mac-address 00:00:00:00:00:00\n\n {% else %}\n\nno ip virtual-router mac-address\n\n {% endif %} # eos_417_up\n\n{% endif %}"}

@dcrearer
Copy link
Author

dcrearer commented Mar 7, 2020

In 2.5 version_compare was renamed to version

https://docs.ansible.com/ansible/latest/user_guide/playbooks_tests.html

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

1 participant