ansible-role-interfaces
ansible-role-interfaces copied to clipboard
Newer version of jinja2 breaks the role
tested with:
- latest role version
1.13.1
- python
3.10
- jinja2
3.1.2
- will fail with:
TASK [MichaelRigart.interfaces : Check active Ethernet interface state] ************
[WARNING]: Skipping plugin (/home/stefan/private/ansible-
homecenter/roles/MichaelRigart.interfaces/filter_plugins/filters.py) as it seems to
be invalid: module 'jinja2' has no attribute 'contextfilter'
fatal: [homecenter]: FAILED! => {"msg": "An unhandled exception occurred while templating '{{ item | ether_check }}'. Error was a <class 'ansible.errors.AnsibleError'>, original message: template error while templating string: No filter named 'ether_check'.. String: {{ item | ether_check }}"}
tested workaround:
- going back to jinja
3.0.3
fixes the problem
I haven't checked which jinja2 version update really introduces the breaking change...
contextfilter is deprecated in jinja2 and can be replaced by pass_context https://github.com/jupyter/nbconvert/issues/1568
We have checked in a fix for this issue in the latest code.
Cool! Will check on the next occasion.