On Mon, Aug 3, 2015 at 8:47 AM, Dimitri Yioulos <dyiou...@gmail.com> wrote:

> Again, I'm close on this.  Using the correct path, as per Rob's write-up,
> did help.  If I run the manifest interactively from the node, it works.
> But, running it on schedule from the puppetmaster doesn't.  Any additional
> help would be greatly appreciated.
>

It might be time to explore shifting that quick script over to puppet
manifests so that Puppet can better handle the settings.

puppet module install puppetlabs/windows ;)


Here is what your first one should look like:

registry_key {
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active
Setup Temp Folders':
  ensure => present,
}

registry_value {
'HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active
Setup Temp Folders\StateFlags0100':
  ensure => present,
  data   => 2,
  type => 'dword',
}


Plus it doesn't have the issue of always running if there is nothing to do.
The exec you have will run every time and report on it.




>
>
> On Wednesday, July 29, 2015 at 3:48:50 PM UTC-4, Dimitri Yioulos wrote:
>>
>> Hello, all.
>>
>> I'm trying to execute the following batch file (sageset.bat) on Win2k8
>> servers:
>>
>> @ECHO OFF
>> REM Enable components to cleanup
>> REG ADD
>> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Active
>> Setup Temp Folders" /v StateFlags0100 /d 2 /t REG_DWORD /f
>> REG ADD
>> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\BranchCache"
>> /v StateFlags0100 /d 2 /t REG_DWORD /f
>> REG ADD
>> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Downloaded
>> Program Files" /v StateFlags0100 /d 2 /t REG_DWORD /f
>> REG ADD
>> "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\GameNewsFiles"
>> /v StateFlags0100 /d 2 /t REG_DWORD /f
>> ~
>>
>> It makes changes to registry settings so that the disk cleanup utility
>> will do a more thorough job of cleanup.  It's the equivalent of running
>> "cleanmgr /d c: /sageset:100", which opens a dialog box that presents a
>> list of files to clean that one can check.
>>
>> The following is in my manifest:
>>
>> exec { 'sageset.bat':
>>          path => $::path,
>>          command => "cmd.exe /c c:\temp\sageset.bat",
>>          provider => windows,
>>          logoutput => true,
>>         }
>>
>> The results of the manifest run are that everything executed
>> successfully.  However, if I run "cleanmgr /d c: /sageset:100" after that,
>> none of the boxes is checked.  Running the batch file in a Windows CLI does
>> work, and if I run "cleanmgr /d c: /sageset:100" after that, all of the
>> boxes are checked.
>>
>> Why am I not getting this to work?
>>
>> Dimitri
>>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/puppet-users/5e717c33-6815-4e16-8833-fd12be0699a4%40googlegroups.com
> <https://groups.google.com/d/msgid/puppet-users/5e717c33-6815-4e16-8833-fd12be0699a4%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Rob Reynolds
Developer, Puppet Labs

*PuppetConf 2015 <http://2015.puppetconf.com/> is coming to Portland,
Oregon! Join us October 5-9.*
*Register now to take advantage of the Early Bird discount
<https://www.eventbrite.com/e/puppetconf-2015-october-5-9-tickets-13115894995?discount=EarlyBird>
*
*—**save $249!*

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/CAMJiBK6xcUc12SZzmg8Rgxfit2B7M-BvPT%3Dc7oZwC%2B-O839t6Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to