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

"Install versions" fails: "pyenv: No such file or directory" #1

Open
blueyed opened this issue Jun 22, 2015 · 6 comments
Open

"Install versions" fails: "pyenv: No such file or directory" #1

blueyed opened this issue Jun 22, 2015 · 6 comments

Comments

@blueyed
Copy link

blueyed commented Jun 22, 2015

When trying this role, it fails to install the versions:

TASK: [dirn.pyenv | Install versions] ***************************************** 
failed: [c.example.com] => (item=2.7.9) => {"cmd": "pyenv install 2.7.9", "failed": true, "item": "2.7.9", "rc": 2}
msg: [Errno 2] No such file or directory
failed: [c.example.com] => (item=3.4.3) => {"cmd": "pyenv install 3.4.3", "failed": true, "item": "3.4.3", "rc": 2}
msg: [Errno 2] No such file or directory
failed: [c.example.com] => (item=pypy-2.5.0) => {"cmd": "pyenv install pypy-2.5.0", "failed": true, "item": "pypy-2.5.0", "rc": 2}
msg: [Errno 2] No such file or directory
failed: [c.example.com] => (item=pypy3-2.4.0) => {"cmd": "pyenv install pypy3-2.4.0", "failed": true, "item": "pypy3-2.4.0", "rc": 2}
msg: [Errno 2] No such file or directory

FATAL: all hosts have already failed -- aborting

The pyenv command is not available yet: the Add to run commands task comes
later, and even then, the pyenv_runcom would need to be sourced before.

@musicformellons
Copy link

I got the same error:
TASK: [dirn.pyenv | Install versions] *****************************************
failed: [127.0.0.1] => (item=3.4.3) => {"cmd": "pyenv install 3.4.3", "failed": true, "item": "3.4.3", "rc": 2}
msg: [Errno 2] No such file or directory

@osman-masood
Copy link

@dirn Yep, getting the same issue.

@dirn
Copy link
Owner

dirn commented Oct 9, 2015

@blueyed, @musicformellons, and @oamasood, what OS?

@osman-masood
Copy link

@dirn
It's from within an Ubuntu 14.04 Docker container. Here's the dockerfile:

FROM ansible/ubuntu14.04-ansible:stable
MAINTAINER Osman Masood <[email protected]>

WORKDIR /root
ADD . my_dir

RUN ansible-galaxy install dirn.pyenv  # Install Ansible role for pyenv from Galaxy

ADD ansible/container-bootstrap.yml /srv/ansible/container-bootstrap.yml
WORKDIR /srv/ansible
RUN ansible-playbook -v container-bootstrap.yml -c local

And my container-bootstrap.yml:

- name: Bootstrap gettalent/base_service_container image
  hosts: local
  tasks:
    - name: update core libs
      apt: update_cache=yes
    - name: install basic packages
      apt: pkg={{ item }} update_cache=yes cache_valid_time=259200  # 3 days
      with_items:
        - curl
        - wget
        - build-essential
        - gcc
        - make
        - zlib1g-dev  
        - libbz2-dev
        - libmysqlclient-dev
        - libreadline-dev
        - libxml2-dev
        - libxslt-dev
        - libssl-dev
        - nginx
        - git
    - name: install Python and Basic Tools
      apt: pkg={{ item }} update_cache=yes cache_valid_time=259200  # 3 days
      with_items:
        - python
        - python-dev
        - python-distribute
        - python-pip
        - python-setuptools
        - software-properties-common
        - python-software-properties


- name: Install python 2.7.9 in pyenv
  hosts: local
  roles:
    - role: dirn.pyenv
      pyenv_virtualenv: false
      pyenv_runcom: ~/.bashrc
      pyenv_versions:
        - 2.7.9
      pyenv_default_versions:
        - 2.7.9
      pyenv_project_versions:
        - 2.7.9

Thanks.

@dirn
Copy link
Owner

dirn commented Oct 9, 2015

Awesome. This will be a huge help.

@dylanninin
Copy link

In install versions command, pyenv should be prefixed with full qualified path:

- name: Install versions
  command: creates={{ pyenv_root }}/versions/{{ item }} {{ pyenv_root }}/bin/pyenv install {{ item }}
  with_items: "{{ pyenv_versions }}"

@dylanninin dylanninin mentioned this issue Jun 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants