the env binary is in /usr/bin and therefore your path is not wide enough.
/sbin:/bin:/usr/sbin:/usr/bin is a good default. Adding /usr/local/bin
and /usr/local/sbin might be good ideas depending on your setup.
Regards, David
On 26.06.2013 15:08, Rahmathulla Badarudeen wrote:> Hi,
>
> I''ve tried to to exec function in puppet for enabling module for
apache.
> Here is the code that I am using:
>
> class apache::mod {
> exec { "a2enmod" :
>
> command => "a2enmod proxy_http",
> path => "/usr/sbin/",
> notify => Class["apache::service"],
> require => Class["apache::install"],
> }
> }
>
> But in agent I''m getting the following error,
>
> notice: /Stage[main]/Sudo/Package[sudo]/ensure: created
> err: /Stage[main]/Apache::Mod/Exec[a2enmod]/returns: change from notrun
> to 0 failed: sh: 1: env: not found
> Could not read /etc/apache2/envvars
>
> notice: /Stage[main]/Apache::Service/Service[apache2]: Dependency
> Exec[a2enmod] has failures: true
>
> Any idea why it is happening like this?
>
> Regards,
> Rahmathulla
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Puppet Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to puppet-users+unsubscribe@googlegroups.com.
> To post to this group, send email to puppet-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/puppet-users.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to puppet-users+unsubscribe@googlegroups.com.
To post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.