Answers: <p>Since Ansible was installed via Homebrew on macOS, the workaround is to install Ansible using Pip.</p>
  
  <pre><code>$ 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] =&gt; {"changed": false, "msg": "2.8"}
  </code></pre>
  
Answers: CC BY-SA 4.0
Answers: 2019-06-06T12:45:11.117Z
Answers: 2019-06-06T12:45:11.117Z
Answers: kenorb
Body: <p>I'm using Ansible 2.8.0 (<code>ansible --version</code> installed by <code>brew</code> on macOS) which is using Jinja 2.10.</p>
  
  <p>I've tried to downgrade Jinja to 2.8 via <code>pip3 install jinja2==2.8</code>, and I can confirm the right version with <code>pip3 list</code>, but Ansible is still using Jinja 2.10 (verified by <a href="https://stackoverflow.com/a/49045145/55075">these steps</a>). It seems it's using different Python's <code>site-packages</code> folder.</p>
  
  <p>I'd like to downgrade Jinja due to <a href="https://github.com/ansible/ansible/issues/51727" rel="nofollow noreferrer">a bug</a>, so I'd like to test Ansible using older version of Jinja.</p>
  
  <p>How do I downgrade Jinja used by Ansible, ideally without downgrading Ansible it-self?</p>
  
  <hr>
  
  <pre><code>$  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
  </code></pre>
  
Tags: <ansible><python><jinja><macos>
Title: How to downgrade Jinja for Ansible?
UserDisplayName: kenorb
ThreadText: # How to downgrade Jinja for Ansible?
  
  (Asked by: username_0 on 2019-06-06)
  
  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](https://stackoverflow.com/a/49045145/55075)). It seems it's using different Python's `site-packages` folder.
  
  I'd like to downgrade Jinja due to [a bug](https://github.com/ansible/ansible/issues/51727), 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/username_0/.ansible.cfg
    configured module search path = ['/Users/username_0/.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
  
  ```
  
  **Tags:** ansible, python, jinja, macos
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-06-06. Score: 1 | Accepted answer
  
  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"}
  
  ```
  
  
  ---
  
  