{"action":"opened","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/14415","repository_url":"https://api.github.com/repos/ansible/ansible","labels_url":"https://api.github.com/repos/ansible/ansible/issues/14415/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/14415/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/14415/events","html_url":"https://github.com/ansible/ansible/issues/14415","id":132759027,"number":14415,"title":"v 2.0.0.2 pip module: using both executable and virtualenv params installs to system instead of in virtual environment","user":{"login":"stefano-m","id":999760,"avatar_url":"https://avatars.githubusercontent.com/u/999760?v=3","gravatar_id":"","url":"https://api.github.com/users/stefano-m","html_url":"https://github.com/stefano-m","followers_url":"https://api.github.com/users/stefano-m/followers","following_url":"https://api.github.com/users/stefano-m/following{/other_user}","gists_url":"https://api.github.com/users/stefano-m/gists{/gist_id}","starred_url":"https://api.github.com/users/stefano-m/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefano-m/subscriptions","organizations_url":"https://api.github.com/users/stefano-m/orgs","repos_url":"https://api.github.com/users/stefano-m/repos","events_url":"https://api.github.com/users/stefano-m/events{/privacy}","received_events_url":"https://api.github.com/users/stefano-m/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-10T17:03:16Z","updated_at":"2016-02-10T17:03:16Z","closed_at":null,"body":"##### Issue Type:\r\n  - Bug Report\r\n\r\n##### Ansible Version:\r\n\r\n```\r\n$ ansible --version\r\nansible 2.0.0.2\r\n  config file = /home/vagrant/ansible.cfg\r\n  configured module search path = Default w/o overrides\r\n```\r\n\r\nI actually encountered this behavior in ansible 1.9.4 too.\r\n\r\n##### Ansible Configuration:\r\n\r\n```\r\n$ cat /home/vagrant/ansible.cfg\r\n[defaults]\r\nhostfile = /home/vagrant/ansible/inventory/development\r\nforks=15\r\nhost_key_checking = False\r\n```\r\n\r\n##### Environment:\r\n\r\nTested on a `bento/ubuntu-14.04` vagrant box.\r\n\r\n```\r\n$ cat /etc/lsb-release\r\nDISTRIB_ID=Ubuntu\r\nDISTRIB_RELEASE=14.04\r\nDISTRIB_CODENAME=trusty\r\nDISTRIB_DESCRIPTION=\"Ubuntu 14.04.3 LTS\"\r\n```\r\n\r\n##### Summary:\r\n\r\nIn the `pip` module, when *both* the `executable` and `virtualenv` parameters are used, the named package is installed in the system instead of in the virtual environment.\r\n\r\n##### Steps To Reproduce:\r\n\r\nRunning the following playbook will install `bottle` in the system rather than in the virtual environment.\r\n\r\n`executable` points to `/usr/bin/pip` because I have installed the latest version of `pip` (namely 8.0.2) using `get-pip.py`.\r\n\r\n```yaml\r\n---\r\n- name: Pip module bug\r\n  hosts: localhost\r\n  become: yes\r\n  vars:\r\n    ansible_connection: local\r\n  tasks:\r\n    - become_user: root\r\n      pip: name=bottle\r\n             state=latest\r\n             executable=/usr/local/bin/pip\r\n             virtualenv=/home/vagrant/myenv\r\n```\r\n\r\nThis will create a virtual environment in `/home/vagrant/myenv` *and* install `bottle` in the system.\r\n\r\nIf the `executable` parameter is removed, then the named package is installed in the virtual environment.\r\n\r\n##### Expected Results:\r\n\r\nI would have expected either that the package were installed inside the virtual environment or that ansible returned an error saying that `executable` and `virtualenv` are not compatible (similarly to `name` vs `requirements`).\r\n\r\n##### Actual Results:\r\n\r\nThis will create a virtual environment in `/home/vagrant/myenv` *and* install `bottle` in the system.\r\n\r\n"}}