I'm setting up ansible to run through jenkins. When I run any command as root user inside the server it runs fine so I know it's working. However when I try to run it through Jenkins I get:
/tmp/jenkins8800425633212024632.sh: line 2: ansible-playbook: command not found
I assumed this is due to the fact that the Jenkins user does not have access to the command, so I checked if I log in as any user that doesn't have root access I get the same error. Am I missing something here? I can't seem to figure out how to let others have access to the command. It was installed by the super user using pip
as recommended, so there's no script in the /bin
folder, could that be the problem?
The problem here was more with Paths than permissions. The jenkins user didn't have the path being exported to these scripts so it either needed to be run with the direct path or actually adding the path to the bash profile.