Project

General

Profile

« Previous | Next » 

Revision d4a730d7

Added by Eric Helms about 10 years ago

Addresses changes made to katello-certs-tools regarding location of
cert generation and password arguments to katello-certs-tools. Provies
cleanup and simplification of where and what certs are used as well as
changing the naming conventions to reflect the fact that Katello is
the project controlling and generating the CA and certs.

View differences:

lib/puppet/type/certs_common.rb
newparam(:regenerate)
newparam(:deploy)
newparam(:password_file)
end
FILE_COMMON_PARAMS = Proc.new do
......
newparam(:path, :namevar => true)
newparam(:password_file)
# make ensure present default
define_method(:managed?) { true }
newparam(:cert) do
# TODO: should be required
newparam(:key_pair) do
validate do |value|
unless value.is_a?(Puppet::Resource) && [:ca, :cert].include?(value.resource_type.name)
raise ArgumentError, "Expected Cert or Ca resource"
unless value.is_a?(Puppet::Resource) && (value.resource_type.name == :ca || value.resource_type.name == :cert)
raise ArgumentError, "Expected Ca or Cert resource"
end
end
end
autorequire(:file) do
@parameters[:path]
end
autorequire(:cert) do
# TODO: find better way how to determine the type
if @parameters.has_key?(:cert) &&
@parameters[:cert].value.resource_type.name == :cert
@parameters[:cert].value.to_hash[:name]
autorequire(:key_pair) do
if @parameters.has_key?(:key_pair)
@parameters[:key_pair].value.to_hash[:name]
end
end
autorequire(:ca) do
if @parameters.has_key?(:cert) &&
@parameters[:cert].value.resource_type.name == :ca
@parameters[:cert].value.to_hash[:name]
end
autorequire(:file) do
@parameters[:path]
end
end

Also available in: Unified diff