If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Bare Metal Provisioning 2008 Puppet: schedule task to start buildbot on cltbld login

RESOLVED FIXED

Status

Infrastructure & Operations
RelOps: Puppet
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: markco, Assigned: markco)

Tracking

Details

(Assignee)

Description

3 years ago
Will need to export the task from a current machine on the domain and the import through exec command in a manifest. 

ref: http://technet.microsoft.com/en-us/library/cc709661.aspx
(Assignee)

Updated

3 years ago
Assignee: relops → mcornmesser
Depends on: 979540
(Assignee)

Comment 1

3 years ago
Added this to buildslave::startup under the Windows clause:


   #Bat file to start build bot
            file {
                'C:/mozilla-build/start-buildbot.bat':
                    source  => "puppet:///modules/buildslave/start-buildbot.bat",
                    require => Class['packages::mozilla::mozilla_build'],
            }
            #XML file to set up a schedule task to to launch build bot on cltbld log in.
            #XML file needs to exported from the task scheduler gui. Also note when using the XML import be aware of machine specific values such as name will need to be replaced with a variable.
            #Hence the need for the template.
            file {
                'C:/mozilla-build/startbuild.xml':
                     content => template("buildslave/startbuildbot.xml.erb"),
                     require => Class['packages::mozilla::mozilla_build'],
            }
            #Importing the XML file using schtasks
            #Refrence http://technet.microsoft.com/en-us/library/cc725744.aspx and http://technet.microsoft.com/en-us/library/cc722156.aspx
            exec { "startbuildbot":
                creates => 'C:\programdata/PuppetLabs/puppet/var/lib/startbuildbot.txt',
                command => '"C:\Windows\winsxs\x86_microsoft-windows-sctasks_31bf3856ad364e35_6.1.7601.17514_none_8c46e17f1398738b\schtasks.exe" /Create  /XML "C:\mozilla-build\startbuild.xml" /tn StartBuildbot',
                require => File['C:/mozilla-build/startbuild.xml'],
           }

From the XML template is the replacement of the exact machine name with: 

<UserId><%= @env_computername %>
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
How does that exec create the file it names?  Also, looks like you're mixing forward and backward slashes there -- is that a problem?
(Assignee)

Comment 3

3 years ago
Missed a portion in the copy.  
             require => File['C:/mozilla-build/startbuild.xml'],
           }
            file {
                'C:/programdata/PuppetLabs/puppet/var/lib/startbuildbot.txt':
                    require => Exec["startbuildbot"],
                    content => "Semaphore",
            }

I am using forward slashes specifically in the file resource name as pointed out previously in  	feedback for the patch attached to 979540. In all other Windows directory paths I use backwards slashes because it requires far less escape characters.
Ah, that additional bit makes more sense :)

I was looking at the backslash in
           creates => 'C:\programdata/PuppetLabs/puppet/var/lib/startbuildbot.txt',
(Assignee)

Comment 5

3 years ago
Ah... I have changed that. I blame late night copy and paste laziness.
You need to log in before you can comment on or make changes to this bug.