Module: PuppetX::Consul::TLSParameters

Defined in:
lib/puppet_x/consul/tls_parameters.rb

Defined Under Namespace

Classes: Path

Class Method Summary collapse

Class Method Details

.apply(type) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/puppet_x/consul/tls_parameters.rb', line 11

def self.apply(type)
  type.validate do
    raise Puppet::Error, 'Consul client_cert and client_key must be supplied together' if self[:client_cert].nil? != self[:client_key].nil?
  end

  type.autorequire(:file) do
    %i[ca_file ca_path client_cert client_key].filter_map { |parameter| self[parameter] }
  end
end