shell issue

This is because when Ansible does "sudo vagrant", it doesn't use an
interactive shell thus your .bash stuff won't be read, and ~/.rvm/bin is
probably not appended to yout path.

I do :
shell bash -lc 'cd; rvm install ...'

to circumvent this (which is not much cleaner :stuck_out_tongue: )

M

You could use the ‘environment’ keyword in ansible to set your path variables if need be.

Got it - thanks!

Can you possibly shed some light on why the configured user’s shell environment is not available when running the ‘shell’ action?

Thanks,
Liam

Michel already answered this.

Ah, I guess my question should have been, “why doesn’t ansible either use an interactive shell (or some other mechanism) to make the user’s environment available?”.

Thanks,
Liam

Well this has been tried (asking ansible to add -i in sudo runs) in the
past. However, many side effects came up (some ansible runs were stuck)
so the patch has been reverted since.

The best way to handle is is probably to write rbenv/rvm modules.

M

Plus I really don’t want the user’s environment (path, etc) as part of the equation.

The goal should be to centrally manage things with authority and not trust the user env.