Did you provide the path attribute in your exec resource? Some like that:
exe {'execute pretty command': command => 'cmd.exe /c echo 'hello world', path => $::path } $::path is a variable that contains all paths contained in this user profile. you can also define it hardcoded. Note: you must have c:\windows\system32 (for cmd.exe) and your ruby bin directory in your path in order your command run well. On Wed, Oct 2, 2013 at 11:41 AM, <beyonddc.stor...@gmail.com> wrote: > I am having a difficult time to determine the cause of why my exec > resource failed to execute a command on Windows. > > Here's the error message reproduced by the Puppet on the windows machine > when I ran 'puppet agent --test'. > > Error: cmd.exe /c ruby -e "File.open('c:\replace_me', 'w') { |f| > f.write(File.read('C:/Documents and Settings/All Users/Application > Data/PuppetLabs/puppet/var/replace_me')) }" returned 1 instead of one of [0] > > Error: > /Stage[main]/Windows_95d7fd26_b0e4_4642_9eb0_a06de0ea2fc7_1380724354040/Exec[rem_a8159a47_5507_4731_9d5f_1587fa8d5803_824177284125062]/returns: > change from notrun to 0 failed: cmd.exe /c ruby -e > "File.open('c:\replace_me', 'w') { |f| f.write(File.read('C:/Documents and > Settings/All Users/Application Data/PuppetLabs/puppet/var/replace_me')) }" > returned 1 instead of one of [0] > > Notice: Finished catalog run in 2.06 seconds > > If I copied and pasted the command manual to a command prompt on Windows > then the command would run successfully. It's just that it when running it > with Puppet then it would failed. Please let know if you see any issue > with my command or if there's any debug technique that I should try. > > Thanks! > > David > > -- > 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+unsubscr...@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+unsubscr...@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.