On Fri, Jul 06, 2012 at 08:44:51AM -0700, jcbollinger wrote:
>
>
> On Friday, July 6, 2012 2:10:13 AM UTC-5, Hendrik J�ger wrote:
> >
> > [...] let a shell
> > execute your command [...]
> >
>
> Which you can do fairly easily by adding "provider => 'sh'" to your Exec's
> parameters.
>
> Or if you need a non-default shell or you just like doing things the hard
> way, then you can use a variation on
>
> bash -c 'my command here'
>
> as your command.
Instead of doing these kinds of work-arounds I'd just use the cwd
parameter of the exec resource as described in the type reference [1]
so e.g.
exec { 'make_sendmail':
command => '/usr/bin/make',
cwd => '/etc/mail'
}
If you have GNU make you can also ask the make command itself to change
the directory (-C dir, --directory=dir)
[1]
http://docs.puppetlabs.com/references/latest/type.html#exec
-Stefan