Skip to content

Commit

Permalink
Merge pull request #703 from mbaitelman/windows-slave-cleanup
Browse files Browse the repository at this point in the history
Mark windows template sensitive if setting password, remove default '…
  • Loading branch information
tas50 authored Nov 14, 2018
2 parents 13d91f1 + 0464024 commit bd3e89c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libraries/slave_windows.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ def slave_xml_resource
@slave_xml_resource = Chef::Resource::Template.new(slave_xml, run_context)
@slave_xml_resource.cookbook('jenkins')
@slave_xml_resource.source('jenkins-slave.xml.erb')
@slave_xml_resource.sensitive = true if new_resource.password
@slave_xml_resource.variables(
new_resource: new_resource,
endpoint: endpoint,
Expand Down Expand Up @@ -263,16 +264,14 @@ def service_resource
end

#
# Windows domain for the user or `.` if a domain is not set.
# Windows domain for the user or nil if there is no domain.
#
# @return [String]
#
def user_domain
@user_domain ||= begin
if (parts = new_resource.user.match(/(?<domain>.*)\\(?<account>.*)/))
parts[:domain]
else
'.'
end
end
end
Expand Down

0 comments on commit bd3e89c

Please sign in to comment.