In my (default generated) ansible.cfg I have uncommented the jinja2_extensions
line and changed it to the following:
jinja2_extensions=['jinja2.ext.do']
But when I run the playbook I get the following errors and then it fails saying it couldn’t find any hosts:
[WARNING]: * Failed to parse /mnt/ansible/hosts with yaml plugin: No module named "['jinja2"
[WARNING]: * Failed to parse /mnt/ansible/hosts with ini plugin: No module named "['jinja2"
I have tried variations on the jinja2_extensions
line, including just leaving it at the jinja2_extensions=[]
default (but uncommented) and it will still fail but with the error No module named '[]'
.
I have also tried using the ANSIBLE_JINJA2_EXTENSIONS env variable instead of setting it in the .cfg but that gives the same error.
Playbook will run fine without trying to load any jinja2 extensions, just it will fail when it gets to a template that requires the do
extension.
Can anyone suggest what the problem is?