# anyway to run different tasks with different interpreters (ex: yum using py2.6, get\_url using py2.7)

**URL:** <https://forum.ansible.com/t/anyway-to-run-different-tasks-with-different-interpreters-ex-yum-using-py2-6-get-url-using-py2-7/22241>\
**Category:** Ansible Project\
**Created:** [August 9, 2016, 9:40am UTC](https://forum.ansible.com/t/anyway-to-run-different-tasks-with-different-interpreters-ex-yum-using-py2-6-get-url-using-py2-7/22241 "2016-08-09T09:40:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sylvain\_Mougenot](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@Sylvain\_Mougenot](https://forum.ansible.com/u/Sylvain_Mougenot)\
**Post date:** [August 9, 2016, 9:40am UTC](https://forum.ansible.com/t/anyway-to-run-different-tasks-with-different-interpreters-ex-yum-using-py2-6-get-url-using-py2-7/22241/1 "2016-08-09T09:40:08Z")

</div>

Hello,  
I’ve to maintain some node running on Centos 6 with Python 2.6 as default python.  
My problem is due to SSL download using gt\_url that require Python 2.7.9+ to work (related to SNI trouble).

Aim :

- run all yum tasks with default Python (2.6, it’s a system requirement)
- run all get\_url tasks with Python 2.7 (required to have ssl working due to SNI)

Tried using ansible\_python\_interpreter, but it looks global (for all modules/tasks).

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [August 9, 2016, 5:22pm UTC](https://forum.ansible.com/t/anyway-to-run-different-tasks-with-different-interpreters-ex-yum-using-py2-6-get-url-using-py2-7/22241/2 "2016-08-09T17:22:11Z")

</div>

it is also a host variable, so it is settable as a normal var in play, just try setting it at the tasks you need

- yum: …  
vars:  
ansible\_python\_interpreter: /usr/bin/python2212
