I need an environment variable added to the front of $PATH
that:
- Doesn't last beyond the provisioning run.
- Is dependent i.e. something will be installed earlier in the run that is then is available via
$PATH
, so I can't set it globally as this cookbook says to.
I tried the answer here:
Exec { environment => [ "foo=$bar" ] }
but I get the error Error: All resource specifications require names
. When I add a name I get other errors about syntax, for which my fiddling around to fix just gives me other errors (the error Syntax error at '}'; expected '}'
is my favourite!)
I've tried using export
to set it, but I see: Error: Could not find command 'export'
I've tried using set
and setenv
too, with similar results. There must be a straightforward way to do this, but I can't find it.
Edit
Just to add, these are the available shells:
$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/bin/zsh
/usr/bin/zsh
zsh is part of the provisioning, but it could be a requirement of the answer, if needs be.