bolt icon indicating copy to clipboard operation
bolt copied to clipboard

CLI run-as option doesn't seem to work

Open nwolfe opened this issue 2 years ago • 1 comments

Describe the Bug

It would seem from documentation that I could configure Bolt to run as root user via the CLI like bolt plan run --run-as root ... or in the inventory.yaml file transport options here https://www.puppet.com/docs/bolt/latest/bolt_transports_reference.html#run-as-5 yet the CLI one doesn't work; I have to put this in inventory file under ssh: config: run-as: root.

Expected Behavior

A clear and concise description of what you expected to happen.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'

Environment

  • Version [e.g. 1.27.0]
  • Platform [e.g. Ubuntu 18.04]

Additional Context

Add any other context about the problem here.

nwolfe avatar Jun 13 '23 20:06 nwolfe

What actions are not using the run-as flag? When i test this with a minimal example (using run_command) the run-as cli option is respected:

(positive_ev) ➜  foo cat foo/plans/init.pp
plan foo(){
  return run_command(whoami, localhost)
}

donoghuc avatar Jun 13 '23 22:06 donoghuc

@nwolfe just to check in and see if this is still an issue for you or if we can close this issue?

davidsandilands avatar Jun 19 '24 14:06 davidsandilands

We can close this, I don't recall the significance of this and was new to Bolt at the time 😃

nwolfe avatar Jun 28 '24 19:06 nwolfe