201: def setconfig(hash)
202: @config = {}
203: Puppet.settings.params("ca").each { |param|
204: param = param.intern if param.is_a? String
205: if hash.include?(param)
206: @config[param] = hash[param]
207: Puppet[param] = hash[param]
208: hash.delete(param)
209: else
210: @config[param] = Puppet[param]
211: end
212: }
213:
214: if hash.include?(:password)
215: @config[:password] = hash[:password]
216: hash.delete(:password)
217: end
218:
219: raise ArgumentError, "Unknown parameters #{hash.keys.join(",")}" if hash.length > 0
220:
221: [:cadir, :csrdir, :signeddir].each { |dir|
222: raise Puppet::DevError, "#{dir} is undefined" unless @config[dir]
223: }
224: end