On Fri, Mar 23, 2012 at 4:33 AM, Jay Ze <iltisannihila...@googlemail.com>wrote:

> On 23 Mrz., 12:16, Paul Tötterman <paul.totter...@gmail.com> wrote:
> > Hi Jay,
> >
> > > exec { 'ExecCreatedFolder':
> > >        command => "mkdir C:\PuppetOrdner\​ExecCreatedFolder",
> > > }
> >
> > mkdir is a command implemented by the windows command processor cmd.exe,
> > not a callable program.
> http://docs.puppetlabs.com/references/stable/type.html#execstates that the
> > Windows provider can only call executables instead of giving commands to
> a
> > shell.
> >
> > That said, have you tried something like 'command => "cmd /c mkdir
> > c:\test"' ?
> I tried it and it didn't work.. but I know what you mean.
>
> It's OK
>

The exec resource requires that command be an absolute path or that you
specify the path parameter to resolve the executable. Since %windir% can
vary across Windows agents, the easiest thing is to do use the agent's path
fact:

exec { 'cmd /c echo hello':
  path => $::path,
  logoutput => true
}

Also note that I didn't specify a '.exe' extension. Puppet uses both the
%PATH% and %PATHEXT% environment variables to resolve the executable. Or
course, you can specify the extension if you want, e.g. cmd.exe /c echo
hello.

>
> > Also, I hope you bring up mkdir purely for the sake of discussion, since
> > file { 'C:/test': ensure => directory } works for creating directories.
> Yes, It was just an example :-)
> Just to try the ressource exec
> >
> > Cheers,
> > Paul
>
> Thx for your quick answer.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>


-- 
Josh Cooper
Developer, Puppet Labs

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to