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

Task fails if python interpreters already exist #57

Open
dephekt opened this issue Oct 20, 2022 · 1 comment · May be fixed by #58
Open

Task fails if python interpreters already exist #57

dephekt opened this issue Oct 20, 2022 · 1 comment · May be fixed by #58

Comments

@dephekt
Copy link

dephekt commented Oct 20, 2022

Maybe I'm using this wrong, but on Linux when I re-run a playbook using this role, after a previous success, it fails:

TASK [ansible_pyenv : Install Python interpreters] *****************************************
failed: [localhost] (item=3.10.3) => {"ansible_loop_var": "item", "changed": true, "cmd": "/home/dephekt//.pyenv/bin/pyenv install 3.10.3", "delta": "0:00:00.024369", "end": "2022-10-21 02:15:19.618294", "item": "3.10.3", "msg": "non-zero return code", "rc": 1, "start": "2022-10-21 02:15:19.593925", "stderr": "pyenv: /root/.pyenv/versions/3.10.3 already exists", "stderr_lines": ["pyenv: /root/.pyenv/versions/3.10.3 already exists"], "stdout": "", "stdout_lines": []}

It looks like there are no checks that an interpreter already exists prior to attempting to do a pyenv install for it.

I expected that it would be relatively idempotent and if versions were already installed it would not attempt to install them again (or at least not error out if it did), but I don't see any attempt at checking them after looking through the code. However, I see there are idempotence tests, so I'm really confused how this is happening.

I'm using Ansible 6.4.0-1ppa~jammy on Ubuntu 22.04. This commit sums up what my ansible-pyenv configuration looks like in my playbook.

@dephekt dephekt linked a pull request Oct 21, 2022 that will close this issue
@dephekt
Copy link
Author

dephekt commented Oct 21, 2022

Opened a draft MR that fixes this issue for me. It has some other work that probably should be added before merging but it at least gives (I hope) a good starting point. I don't know enough about how tests work in Travis with Ansible to write a test case that triggers this failure, but that's one thing that probably should be added to that MR.

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

Successfully merging a pull request may close this issue.

1 participant