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

sudo: ansible-playbook: command not found #27

Closed
m-roberts opened this issue Jul 19, 2021 · 1 comment · Fixed by #28
Closed

sudo: ansible-playbook: command not found #27

m-roberts opened this issue Jul 19, 2021 · 1 comment · Fixed by #28

Comments

@m-roberts
Copy link

m-roberts commented Jul 19, 2021

Without sudo, the command resolves to/opt/pipx_bin/ansible-playbook .... With sudo, we get /usr/bin/sudo ansible-playbook ..., which results in the error.

I'm guessing that its losing the PATH - Perhaps sudo --preserve-env would fix this?

Running in a GitHub Action workflow directly, this is also the case. I have to run sudo $(which ansible-playbook) to resolve the command path currently.

@m-roberts m-roberts changed the title Running with sudo doesn't work sudo: ansible-playbook: command not found Jul 19, 2021
@dawidd6
Copy link
Owner

dawidd6 commented Jul 19, 2021

Please submit a PR for this. Even better if you include a test for it in workflows.

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.

2 participants