Skip to content

Conversation

ldenefle
Copy link

This PR fixes an issue I ran into when trying to use the role while becoming a non-user

My playbook looked like this

- name: install pyenv for a specific user
  hosts: my_host
  become: yes
  become_user: my_non_root_user
  roles: [markosamuli.pyenv]

When attempting this, the role fails when trying to update dependencies for pyenv on Linux. The reason for that is the role tries to become to use package which is valid as Ansible defaults become_user is root but in the case of a user-specific installation it does not work.
A simple fix is to specify the root user in Install pyenv build requirements.

Allows to use role when already becoming a non-root user
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 this pull request may close these issues.

1 participant