2

I'm using Ansible 2.8.0 (ansible --version installed by brew on macOS) which is using Jinja 2.10.

I've tried to downgrade Jinja to 2.8 via pip3 install jinja2==2.8, and I can confirm the right version with pip3 list, but Ansible is still using Jinja 2.10 (verified by these steps). It seems it's using different Python's site-packages folder.

I'd like to downgrade Jinja due to a bug, so I'd like to test Ansible using older version of Jinja.

How do I downgrade Jinja used by Ansible, ideally without downgrading Ansible it-self?


$  ansible --version
ansible 2.8.0
  config file = /Users/kenorb/.ansible.cfg
  configured module search path = ['/Users/kenorb/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/Cellar/ansible/2.8.0/libexec/lib/python3.7/site-packages/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.7.3 (default, Mar 27 2019, 09:23:15) [Clang 10.0.1 (clang-1001.0.46.3)]
$  pip3 --version
pip 19.0.3 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
$  brew info ansible
ansible: stable 2.8.0 (bottled), HEAD
kenorb
  • 8,011
  • 14
  • 43
  • 80

1 Answers1

1

Since Ansible was installed via Homebrew on macOS, the workaround is to install Ansible using Pip.

$ brew remove ansible
$ pip3 install ansible
$  pip3 list | grep -e ansible -e Jinja2
ansible      2.8.0  
Jinja2       2.8    
$  ansible-playbook check_jinja.yaml -v
TASK [jinja_version]
ok: [localhost] => {"changed": false, "msg": "2.8"}
kenorb
  • 8,011
  • 14
  • 43
  • 80