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

Fail to create user pyenv install. Fail at unprivileged #213

Open
RemiDesgrange opened this issue Jun 29, 2023 · 2 comments
Open

Fail to create user pyenv install. Fail at unprivileged #213

RemiDesgrange opened this issue Jun 29, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@RemiDesgrange
Copy link

I'm using the role in a playbook like this:

---
- hosts: my_servers
  roles:
    - role: staticdev.pyenv
      become: yes
      pyenv_version: "v2.3.21"
      pyenv_env: "user"
      pyenv_owner: "deployer"
      pyenv_enable_virtualenvs: true
      pyenv_virtualenvs: [{ venv_name: deployer, py_version: "3.10.10" }]

I'm connecting to the host via a simple user, which can become without a password. I'm failing to understand why it doesn't work.

Here is the failure:

FAILED! => {"msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chmod: invalid mode: ‘A+user:deployer:rx:allow’\nTry 'chmod --help' for more information.\n}). For information on working around this, see https://docs.ansible.com/ansible-core/2.15/user_guide/become.html#risks-of-becoming-an-unprivileged-user"}
@staticdev staticdev added the bug Something isn't working label Jan 7, 2024
@sla-te
Copy link

sla-te commented Mar 13, 2024

+1 (with a user, that has a password set, that though gets injected via Credential)
But a different error:

fatal: [build]: FAILED! => {"changed": false, "msg": "There was an issue creating /etc/ansible as requested: [Errno 13] Permission denied: b'/etc/ansible'", "path": "/etc/ansible/facts.d"}
    - role: staticdev.pyenv
      become: yes
      vars:
        pyenv_python_versions: "{{ pyenv_python_versions }}"
        pyenv_global: "{{ pyenv_python_versions }}"
        pyenv_python_configure_opts: "--enable-optimizations --with-lto --with-ensurepip=upgrade"
        pyenv_virtualenvs:
          - venv_name: "{{ app_name }}_{{ pyenv_python_versions }}"
            py_version: "{{ pyenv_python_versions }}"

@sla-te
Copy link

sla-te commented Apr 10, 2024

After some testing I found, that even things like ansible.builtin.apt fail in case of using become: true in combination with any become_user, that is not root, so I guess its improper usage on my end. In any case it does work if leaving out any become configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants