Or even escape the whitespace:

exec { “c:/program\ files/telegraf/telegraf.exe --service install": 

> On 8. Dec 2020, at 23:25, Michael Watters <[email protected]> wrote:
> 
> Probably need to quote the executable due to spaces:
> 
> exec { '"c:/program files/telegraf/telegraf.exe" --service install': 
> 
> Looks like that worked.  Thanks for the help.
> On Tuesday, December 8, 2020 at 1:58:12 PM UTC-5 Josh Cooper wrote:
> On Tue, Dec 8, 2020 at 10:37 AM Michael Watters <[email protected] 
> <applewebdata://677F94FA-DEE4-4D68-9A7C-0C23F3FC1319>> wrote:
> Here is the exact error message.
> 
> Info: /Stage[main]/Dart::Abstract::Windows_node/File[c:/program 
> files/telegraf/telegraf.conf]: Scheduling refresh of Exec[c:/program 
> files/telegraf/telegraf.exe --service install]
> Error: Could not find command 'c:/program'
> Error: /Stage[main]/Dart::Abstract::Windows_node/Exec[c:/program 
> files/telegraf/telegraf.exe --service install]/returns: change from 'notrun' 
> to ['0'] failed: Could not find command 'c:/program'
> 
> The manifest resource is defined as follows.
> 
> exec { 'c:/program files/telegraf/telegraf.exe --service install':
>         cwd => 'c:/program files/telegraf',
>         refreshonly => true,
>  }
> 
> On Tuesday, December 8, 2020 at 1:29:55 PM UTC-5 Michael Watters wrote:
> I tried that as well and it simply results in an error stating "Could not 
> find command: c:/program".
> 
> Probably need to quote the executable due to spaces:
> 
> exec { '"c:/program files/telegraf/telegraf.exe" --service install': 
> ...
> 
> 
> On Monday, December 7, 2020 at 2:06:53 PM UTC-5 Martin Alfke wrote:
> Have you tried using the full path to the executable? 
> 
> exec { 'c:/program files/telegraf/telegraf.exe --service install' : 
> ... 
> } 
> 
> > On 7. Dec 2020, at 18:17, Michael Watters <[email protected] <>> wrote: 
> > 
> > I have an exec resource in a manifest for our Windows nodes however the 
> > command is failing each time that puppet runs. Here is the definition of 
> > the resource and a screenshot of the error. 
> > 
> > ~> exec { 'telegraf.exe --service install': 
> > cwd => 'c:/program files/telegraf', 
> > refreshonly => false, 
> > } 
> > 
> > 
> > 
> > Is there a way to resolve this? I've tried changing the path parameters 
> > which doesn't make any difference. 
> > 
> > 
> > 
> > -- 
> > 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 [email protected] <>. 
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/puppet-users/ca2819ca-1930-4842-8ed8-0820f19ea343n%40googlegroups.com
> >  
> > <https://groups.google.com/d/msgid/puppet-users/ca2819ca-1930-4842-8ed8-0820f19ea343n%40googlegroups.com>.
> >  
> 
> 
> -- 
> 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 [email protected] 
> <applewebdata://677F94FA-DEE4-4D68-9A7C-0C23F3FC1319>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/88f80e94-2efc-4ca7-bfb1-70abd422f44dn%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/puppet-users/88f80e94-2efc-4ca7-bfb1-70abd422f44dn%40googlegroups.com?utm_medium=email&utm_source=footer>.
> 
> 
> -- 
> Josh Cooper | Software Engineer
> [email protected] <applewebdata://677F94FA-DEE4-4D68-9A7C-0C23F3FC1319>
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/puppet-users/b54d0549-46f0-4c76-b264-8a2d0af98581n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/puppet-users/b54d0549-46f0-4c76-b264-8a2d0af98581n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/BA94B90A-AF47-4B02-B097-EDD2185C0CFA%40gmail.com.

Reply via email to