Open scibi opened 7 years ago
Thanks for reporting. Using Jinja 2.8.1 seems to be the current workaround. Have you tried to remove one of the imports from the effected template to confirm that this is related to the issue you posted? The role only uses Jinja import
s.
Ping @scibi
Hi!
I'm sorry. I didn't make such test. I've just downgraded and didn't investigate further.
Hi @ypid !
I'm back with the same bug ;) This time I'm using current code from debops repo and:
ansible==2.4.2.0
debops==0.6.1
Jinja2==2.10
Role fails with following error:
TASK [debops.apache : Create conf-available snippets] *************************************************************************************************************************************************************
[WARNING]: Unable to find 'lookup/ferm__fix_dependent_rules.j2' in expected paths.
failed: [XXX] (item={'key': u'local-debops_apache', 'value': True}) => {"changed": false, "failed": true, "item": {"key": "local-debops_apache", "value": true}, "msg": "AnsibleError: {{ lookup(\"template\", \"lookup/ferm__fix_dependent_rules.j2\", convert_data=False) | from_json }}: An unhandled exception occurred while running the lookup plugin 'template'. Error was a <class 'ansible.errors.AnsibleError'>, original message: the template file lookup/ferm__fix_dependent_rules.j2 could not be found for the lookup"}
Removing one import
statement helps. Downgrading Jinja2 to 2.8.1 sovles the issue too. That's weird because ansible/ansible#20494 was fixed in 2.4...
The same error with the same issue about not finding lookup/ferm__fix_dependent_rules.j2
shows up in debops.nginx
role as well, when Jinja >2.8 is installed.
I can see in the template file that the apache__tpl_macros.j2
file is imported two times, this entry is there from the start. Probably a misspelling... If @scibi reports that removing one helps with the bug, I'll remove one of the import
statements in the monorepo version of the role right away.
I wonder what's the solution for debops.nginx
error. Maybe something related to extends
?
Edit: Ah, scratch that - these are different files. But one also imports the other, so it seems that debops__tpl_macros.j2
is effectively imported two times?
i could resove this issue by uninstalling the pip version of jinya2 and use the debian package instead. This installed jinya2 (2.8.1) and the problem with nginx been gone for me.
I tried using this role but unfortunately it was failing like that:
I tried to debug it but I couldn't find any reason for this behavior. Then I found ansible/ansible#20494. And it looks like this role is affected.
I'm using:
Everything seems to work after downgrading Jinja to 2.8.1.