Skip to content

Commit

Permalink
Mark windows template sensitive if setting password, remove default '…
Browse files Browse the repository at this point in the history
….' for windows users domain

Signed-off-by: Mendy Baitelman <[email protected]>
  • Loading branch information
mbaitelman committed Nov 13, 2018
1 parent 13d91f1 commit 0464024
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 0464024

Please sign in to comment.