command_execution_as_user

Execute a command as a given user.

⚙️ Compatible targets: Linux

Parameters

NameDocumentation
commandCommand to run.

This parameter is required.
userUser under which to run the command.

This parameter is required.

Outcome conditions

You need to replace ${command} with its actual canonified value.

  • ✅ Ok: command_execution_as_user_${command}_ok
    • ☑️ Already compliant: command_execution_as_user_${command}_kept
    • 🟨 Repaired: command_execution_as_user_${command}_repaired
  • ❌ Error: command_execution_as_user_${command}_error

Example

method: command_execution_as_user
params:
  user: VALUE
  command: VALUE

Documentation

Execute the Command in shell using a specific user.

On Unix based agents, the method status will report:

  • a Repaired if the return code is "0"
  • an Error if the return code is not "0"