Issue #12630 has been updated by Josh Cooper.

Description updated


----------------------------------------
Feature #12630: Add scheduled task for executing puppet periodically
https://projects.puppetlabs.com/issues/12630#change-55094

Author: Josh Cooper
Status: Accepted
Priority: Normal
Assignee: Josh Cooper
Category: windows
Target version: 2.7.x
Affected Puppet version: 
Keywords: 
Branch: 


The puppet msi should create a scheduled task to execute puppet agent every 30 
minutes. The task should be configured to run as SYSTEM (aka LocalSystem).

On 2003:

<pre>
C:\>schtasks.exe /create /sc minute /mo 30 /tn puppet /ru SYSTEM /tr 
"c:\path\to\puppet.bat agent"
INFO: The schedule task "puppet" will be created under user name ("NT 
AUTHORITY\SYSTEM").
SUCCESS: The scheduled task "puppet" has successfully been created.
</pre>

On 2008/Vista/etc, see 
<http://technet.microsoft.com/en-us/library/cc722152.aspx>, we need to "run 
with highest privileges":

<pre>
C:\>schtasks.exe /create /sc minute /mo 30 /tn puppet /ru SYSTEM /rl highest 
/tr "c:\path\to\puppet.bat agent"
SUCCESS: The scheduled task "puppet" has successfully been created.
</pre>

Arguments can be specified in the scheduled task, e.g. puppet.bat agent --debug.

The version of windows can be detected using facter 
(Facter.value(:kernelmajversion).to_f >= 6.0) See this page for information 
about major versions in windows 
<http://msdn.microsoft.com/en-us/library/windows/desktop/ms724832(v=vs.85).aspx>

During uninstall we should remove the scheduled task.

<pre>
C:\>schtasks /delete /tn puppet
</pre>

Note that the installer should not add ruby to the system PATH environment 
variable, as doing so would require a reboot for the scheduled task to run. 
Since we know the location of where we installed puppet, we know where the ruby 
bin directory is, and can install from there 


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to