run expect task in virtualenv, and not other tasks

11 views
Skip to first unread message

John Lofgren

unread,
Aug 11, 2017, 11:28:38 AM8/11/17
to Ansible Project
I'm having trouble figuring out how I can run a task with 'expect' module in a virtualenv and not have my other tasks run in that virtualenv.

The only way I've found to run an expect task in a virtualenv is to set_fact ansible_python_interpreter, but once I've done that, I cannot unset it, so all python-related tasks that run after that also run in the same virtualenv. Is there some way to set the python interpreter for only a single expect task?

I use pew (https://github.com/berdario/pew) for managing virtualenvs, but that is likely not relevant.

Thanks,
John
Reply all
Reply to author
Forward
0 new messages