I’m running an Ansible job wherein I’m switching the user to a Service Account to run a certain command. I am able to switch the user and confirm the same using the become method and then a raw: whoami. When in the same scenario post the become method, I’m trying to run the below command,
shell: java -version
it says java command not found. The Service Account does have the privilege of running this command on the server and I’m able to successfully run the same directly from the server.
Could anyone tell me what could be done here?
Thanks in Advance.