Hi Michael,

On Fri, Jun 22, 2012 at 11:00 AM, Josh Cooper <j...@puppetlabs.com> wrote:
>
> Hi Michael
>
> On Fri, Jun 22, 2012 at 10:33 AM, Michael Baydoun <indymicha...@gmail.com> 
> wrote:
>>
>> My windows client is running Windows 2003 Server 32 bit
>>
>>
>> On Wed, Jun 20, 2012 at 3:38 PM, Josh Cooper <j...@puppetlabs.com> wrote:
>>>
>>> Hi Michael,
>>>
>>> On Wed, Jun 20, 2012 at 10:29 AM, Michael Baydoun <indymicha...@gmail.com> 
>>> wrote:
>>>>
>>>> have the following in my manifest to delete old uninstall directories and 
>>>> logs
>>>> using exec since we don't have tidy for windows yet
>>>>
>>>> {code}
>>>>         exec { 'CleanupOldUninstallDirs':
>>>>           command => 'C:\Windows\system32\forfiles.exe -p "C:\Windows" -m 
>>>> "$NtUninstall*" -d -65 -c "cmd /c dev /F /S /Q @path"',
>>>>         }
>>>>         exec { 'CleanupOldPatchLogs':
>>>>           command => 'C:\Windows\system32\forfiles.exe -p "C:\Windows" -m 
>>>> "KB*.log" -d -365 -c "cmd /c dev /F /S /Q @path"',
>>>>         }
>>>> {code}
>
>
> Puppet requires that exec resources return non-zero exit status if the 
> command fails. If I run the following, it still returns 0:
>
> C:\>forfiles -p c:\windows -m "$NtUninstall*" -d -65 -c "cmd /c foo"
> 'foo' is not recognized as an internal or external command,
> operable program or batch file.
> ...
> C:\>echo %ERRORLEVEL%
> 0
>
> I think the issue is that dev is in your PATH when run from the command line, 
> but is not in the PATH that puppet is running with. Try specifying the `path` 
> parameter in your exec resources, e.g.
>
> path => 'c:\windows\system32;c:\windows;c:\path\to\dev;etc'
>

Or is that a typo? Should that be `del` instead of `dev`?

>>>>
>>>> runs correctly debug output below
>>>>
>>>>
>>>> however, files are not deleted, as evidenced by running the same forfiles 
>>>> at the command line
>>>>
>>>>
>>>>
>>>> yet the forfiles with delete works if I run it from the windows command 
>>>> line
>>>>
>>>> Suggestions?  Bug?
>>>>
>>>>
>>>> --
>>>> 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.
>>>
>>>
>>> If this is a 64-bit OS, then I'm guessing it's an issue with filesystem 
>>> redirection. Ruby is a 32-bit app, so any filesystem access to 
>>> c:\windows\system32 is redirected to c:\windows\syswow64. You can avoid 
>>> this by specifying c:\windows\sysnative instead.
>>>
>>> Josh
>>>
>>> --
>>> 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.
>>
>>
>> --
>> 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
>



--
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