Problem:
When i try to run the sudo command from the foreman to the remote host getting below error:
Not root, Subscription Management repositories not updated
2:
Error: This command has to be run with superuser privileges (under the root user on most systems).
3:
Package action failed, exiting…
4:
Exit status: 1
5:
StandardError: Job execution failed
Expected outcome:
the commands need to be completed with the sudo action.
Foreman version 3.14
Any advise or help on this request is apprecicated. Thanks
How exactly are you doing that?
I am trying to run the erata package installation via scheduled job getting the above error.
Below is the error when try to run touch
1:
touch: cannot touch ‘/scripts/test-foreman’: Permission denied
2:
Exit status: 1
3:
StandardError: Job execution failed
Adding screenshot for your Ref.
Those screenshots show what happens when you somehow run a job. What I’m asking about is what are all the inputs you provided when launching the jobs.
From the screenshots you provided, I can only tell that you probably have a connection user set to a non-root user and haven’t set effective user to root. This makes the job run as the unprivileged connection user, which then makes things which require elevated privileges fail.