sous-chefs / jenkins

Development repository for the jenkins cookbook
https://supermarket.chef.io/cookbooks/jenkins
Apache License 2.0
424 stars 635 forks source link

Install JNLP Slave to run as LocalSystem - library forces domain in XML #693

Closed Brantone closed 5 years ago

Brantone commented 6 years ago

Cookbook version

6.2.0

Chef-client version

13.10.0

Platform Details

Windows 2016 Server

Scenario:

Install Jenkins slave as LocalSystem account

Expected Result:

Install agent as JNLP and run as LocalSystem account

Actual Result:

2018-08-01 07:04:08,635 INFO  - Installing the service with id 'jenkins-slave'
LookupAccountName failed: 1332
Failed to set logon as a service right

If jenkins-slave.xml has <domain>.</domain> in it, then it fails, but that line is removed it works; however. due to https://github.com/chef-cookbooks/jenkins/blob/master/libraries/slave_windows.rb#L275 there's no way domain is empty, thus https://github.com/chef-cookbooks/jenkins/blob/master/templates/jenkins-slave.xml.erb#L65 is redundant.

Will look at submitting PR.

Brantone commented 6 years ago

Actually, just realized, if pass:

user ' \\LocalSystem'

then it works (space before \\), so if anything README should be updated ... will leave this ticket on chance it helps someone else

mbaitelman commented 5 years ago

This was fixed in PR703

Brantone commented 5 years ago

👍