Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

easy_install fails to install pip with ok #16519

Closed
jayenashar opened this issue Jun 30, 2016 · 6 comments
Closed

easy_install fails to install pip with ok #16519

jayenashar opened this issue Jun 30, 2016 · 6 comments
Labels
affects_2.1 This issue/PR affects Ansible v2.1 bug This issue/PR relates to a bug.

Comments

@jayenashar
Copy link

ISSUE TYPE
  • Bug Report
ANSIBLE VERSION
ansible 2.1.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides

I also tried this on 1.9.4 before upgrading.

CONFIGURATION

pipelining = True

OS / ENVIRONMENT

CentOS release 6.7 amd64 managing CentOS release 6.7 amd64

SUMMARY

tried to easy_install pip. kept saying "ok" even though it didn't seem to install it (and it wasn't installed). added sudo: yes to make it say "changed" (and pip was installed).

STEPS TO REPRODUCE

The example playbook does not install pip and then the pip command fails. Failed to find required executable pip

    - easy_install: name=pip state=latest
    - pip: name=python-augeas
EXPECTED RESULTS

I expected easy_install to fail.

ACTUAL RESULTS
TASK [easy_install] ************************************************************
task path: /home/jayen/ansible-playbooks/hosts.yaml:7
<bigbang.buzzhives.com> ESTABLISH SSH CONNECTION FOR USER: None
<bigbang.buzzhives.com> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/jayen/.ansible/cp/ansible-ssh-%h-%p-%r bigbang.buzzhives.com '/bin/sh -c '"'"'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python && sleep 0'"'"''
ok: [bigbang.buzzhives.com] => {"binary": "/usr/bin/easy_install", "changed": false, "invocation": {"module_args": {"executable": "easy_install", "name": "pip", "state": "latest", "virtualenv": null, "virtualenv_command": "virtualenv", "virtualenv_site_packages": false}, "module_name": "easy_install"}, "name": "pip", "virtualenv": null}

TASK [pip] *********************************************************************
task path: /home/jayen/ansible-playbooks/hosts.yaml:8
<bigbang.buzzhives.com> ESTABLISH SSH CONNECTION FOR USER: None
<bigbang.buzzhives.com> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/jayen/.ansible/cp/ansible-ssh-%h-%p-%r bigbang.buzzhives.com '/bin/sh -c '"'"'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python && sleep 0'"'"''
fatal: [bigbang.buzzhives.com]: FAILED! => {"changed": false, "failed": true, "invocation": {"module_args": {"chdir": null, "editable": true, "executable": null, "extra_args": null, "name": "python-augeas", "requirements": null, "state": "present", "umask": null, "use_mirrors": true, "version": null, "virtualenv": null, "virtualenv_command": "virtualenv", "virtualenv_python": null, "virtualenv_site_packages": false}, "module_name": "pip"}, "msg": "Failed to find required executable pip"}
@jctanner
Copy link
Contributor

@jayenashar Please add this task after the easy_install task and provide the -vvvv output ...

- shell: which easy_install ; easy_install -m pip

@jctanner jctanner added the needs_info This issue requires further information. Please answer any outstanding questions. label Jun 30, 2016
@jctanner
Copy link
Contributor

note: this should be moved to the ansible-modules-core repo per https://github.com/ansible/ansible/blob/devel/ticket_stubs/module_repo.md but i'm letting it stay here until we know which module is at fault. I suspect easy_install believes pip is installed but doesn't know it hasn't been put into a location that is part of $PATH.

@jayenashar
Copy link
Author

I had to use a different target host because I've already started using pip on the first one.

pip is not installed anywhere on the target host.

TASK [easy_install] ************************************************************
task path: /home/jayen/ansible-playbooks/hosts.yaml:7
<nucleosynthesis.buzzhives.com> ESTABLISH SSH CONNECTION FOR USER: None
<nucleosynthesis.buzzhives.com> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/jayen/.ansible/cp/ansible-ssh-%h-%p-%r nucleosynthesis.buzzhives.com '/bin/sh -c '"'"'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python && sleep 0'"'"''
ok: [nucleosynthesis.buzzhives.com] => {"binary": "/usr/bin/easy_install", "changed": false, "invocation": {"module_args": {"executable": "easy_install", "name": "pip", "state": "latest", "virtualenv": null, "virtualenv_command": "virtualenv", "virtualenv_site_packages": false}, "module_name": "easy_install"}, "name": "pip", "virtualenv": null}

TASK [command] *****************************************************************
task path: /home/jayen/ansible-playbooks/hosts.yaml:9
<nucleosynthesis.buzzhives.com> ESTABLISH SSH CONNECTION FOR USER: None
<nucleosynthesis.buzzhives.com> SSH: EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o ControlPath=/home/jayen/.ansible/cp/ansible-ssh-%h-%p-%r nucleosynthesis.buzzhives.com '/bin/sh -c '"'"'LANG=C LC_ALL=C LC_MESSAGES=C /usr/bin/python && sleep 0'"'"''
fatal: [nucleosynthesis.buzzhives.com]: FAILED! => {"changed": true, "cmd": "which easy_install ; easy_install -m pip", "delta": "0:00:00.083565", "end": "2016-07-01 12:53:20.265306", "failed": true, "invocation": {"module_args": {"_raw_params": "which easy_install ; easy_install -m pip", "_uses_shell": true, "chdir": null, "creates": null, "executable": null, "removes": null, "warn": true}, "module_name": "command"}, "rc": 1, "start": "2016-07-01 12:53:20.181741", "stderr": "error: can't create or remove files in install directory\n\nThe following error occurred while trying to add or remove files in the\ninstallation directory:\n\n    [Errno 13] Permission denied: '/usr/lib/python2.6/site-packages/test-easy-install-7989.write-test'\n\nThe installation directory you specified (via --install-dir, --prefix, or\nthe distutils default setting) was:\n\n    /usr/lib/python2.6/site-packages/\n\nPerhaps your account does not have write access to this directory?  If the\ninstallation directory is a system-owned directory, you may need to sign in\nas the administrator or \"root\" account.  If you do not have administrative\naccess to this machine, you may wish to choose a different installation\ndirectory, preferably one that is listed in your PYTHONPATH environment\nvariable.\n\nFor information on other options, you may wish to consult the\ndocumentation at:\n\n  http://peak.telecommunity.com/EasyInstall.html\n\nPlease make the appropriate changes for your system and try again.", "stdout": "/usr/bin/easy_install", "stdout_lines": ["/usr/bin/easy_install"], "warnings": []}

@ansibot ansibot added affects_2.1 This issue/PR affects Ansible v2.1 and removed needs_info This issue requires further information. Please answer any outstanding questions. labels Sep 7, 2016
@thegreatjerboa
Copy link

I ran into the same thing. And got the same output as @jayenashar. After seeing the permission error, I added become: true and it worked correctly.

@Lujeni
Copy link
Contributor

Lujeni commented Dec 28, 2016

Hello @jayenashar @jctanner @thegreatjerboa

The plugin never test the result command of the is_package_installed function.
This PR #19705 should be enought to fix the problem.

Feel free to test on your side.

@abadger
Copy link
Contributor

abadger commented Jan 5, 2017

PR #19705 has been merged and cherry picked to stable-2.2 which should fix this problem. Closing ticket.

@abadger abadger closed this as completed Jan 5, 2017
@ansibot ansibot added bug This issue/PR relates to a bug. and removed bug_report labels Mar 7, 2018
@ansible ansible locked and limited conversation to collaborators Apr 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.1 This issue/PR affects Ansible v2.1 bug This issue/PR relates to a bug.
Projects
None yet
Development

No branches or pull requests

6 participants