Emit a debug message with ca_file behavior

This commit is contained in:
Victor Cabezas 2020-04-20 10:33:03 +02:00
parent d42bbd1c9b
commit 5669fde765

View File

@ -52,8 +52,6 @@ module PuppetX
tls = Puppet[:ldaptls] tls = Puppet[:ldaptls]
ca_file = "#{Puppet[:confdir]}/ldap_ca.pem" ca_file = "#{Puppet[:confdir]}/ldap_ca.pem"
# TODO: if not exists ldap_ca.pem fail
conf = { conf = {
host: host, host: host,
port: port port: port
@ -72,7 +70,10 @@ module PuppetX
method: :simple_tls method: :simple_tls
} }
if File.file?(ca_file) if File.file?(ca_file)
Puppet.debug("Using #{ca_file} as CA for TLS connection")
conf[:encryption][:tls_options] = { ca_file: ca_file } conf[:encryption][:tls_options] = { ca_file: ca_file }
else
Puppet.debug("#{ca_file} not found, using default CAs installed in your system")
end end
end end