Bug 1417711

Summary: latest update of python2-jinja2 (2.8-7.fc25) breaks ansible-playbooks with j2 templates
Product: [Fedora] Fedora Reporter: Andreas Stolzenberger <astolzen>
Component: ansibleAssignee: Kevin Fenzi <kevin>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 25CC: a.badger, athmanem, kevin, kupo, mark, maxim, toromoti
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-30 20:20:03 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andreas Stolzenberger 2017-01-30 17:47:45 UTC
Description of problem:
ansible playbooks using j2 template: Module with j2 do not work, after updating "python2-jinja2"to version 2.8-7.fc25

ERROR! Unexpected Exception: The 'jinja2<2.9' distribution was not found and is required by ansible

Version-Release number of selected component (if applicable):
- ansible: 2.2.1.0
- python2-jinja2: 2.8-7.fc25

How reproducible:
- simply yum update F25 to current built (1/30/17), run ansibple playbook using template-module

Steps to Reproduce:
1. Install ansible and python-jinja2, latest
2. create ansible playbook using "template:" module
3. run template

Actual results:
ERROR! Unexpected Exception: The 'jinja2<2.9' distribution was not found and is required by ansible

Expected results:
running playbook

Additional info:
rollback of python2-jinja2 to 2.8.1-1.fc25 will resolve issue
-> dnf downgrade python2-jinja2
-> playbooks run again.

Comment 1 Kevin Fenzi 2017-01-30 18:19:15 UTC
This report doesn't make much sense to me. The test is for jinja2 less than 2.9, and any 2.8* version will be less than 2.9. 

Additionally, 2.8.1-1.fc25 is the current one, 2.8-7.fc25 would be a downgrade from that version not the other way around. 

I cannot duplicate the problem with either version installed. 

Do you perhaps have another version installed via pip or the like?

Comment 2 Andreas Stolzenberger 2017-01-30 19:45:29 UTC
Sorry. Like you said: Versions are vice versa. And it still works, when I dnf update the python2-jinja2 back to 2.8.1-1.

But I updated some pip packages yesterday:

>pip search jnja2 
... 
Jinja2 (2.9.5)
  INSTALLED: 2.9.5 (latest)
... 

So the pip installed version probably overwrote the dnf installed one, until I did the dnf downgrade/upgrade. 

Thanks, problem solved. Don't mess with two python package managers, you'll end up in dependency hell ;-)

Comment 3 Kevin Fenzi 2017-01-30 20:20:03 UTC
Glad this was not too hard to track down. ;) These kinds of things often are worse. ;) 

Its like the old saying: 

Man with one watch always knows what time it is. Man with two watches is never quite sure.