Skip to content

Instantly share code, notes, and snippets.

@ahpook
Created December 1, 2016 23:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ahpook/4eaf2e1fa00891377dec3107230ce2d4 to your computer and use it in GitHub Desktop.
Save ahpook/4eaf2e1fa00891377dec3107230ce2d4 to your computer and use it in GitHub Desktop.
newparam(:ca) do
validate do |value|
if value && !value.is_a?(Puppet::Resource)
raise ArgumentError, "Expected Ca resource, got #{value.inspect}"
end
if value.resource_type.name != :ca
raise ArgumentError, "Expected Ca name to be ca, got #{value.resource_type.name}"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment