X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fdsa-puppet.git;a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Ffqdn_uuid.rb;h=e325fe73233e14a4741201f583858624f68f85b8;hp=5080e8ebfcc371ae7b9cb295f37d12da1acb9d4d;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/fqdn_uuid.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/fqdn_uuid.rb index 5080e8ebf..e325fe732 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/fqdn_uuid.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/fqdn_uuid.rb @@ -4,34 +4,16 @@ require 'digest/sha1' # module Puppet::Parser::Functions newfunction(:fqdn_uuid, :type => :rvalue, :doc => <<-DOC) do |args| - Creates a UUID based on a given string, assumed to be the FQDN + @summary + Returns a [RFC 4122](https://tools.ietf.org/html/rfc4122) valid version 5 UUID based + on an FQDN string under the DNS namespace - For example, to generate a UUID based on the FQDN of a system: + @return + Returns a [RFC 4122](https://tools.ietf.org/html/rfc4122) valid version 5 UUID - Usage: - - $uuid = fqdn_uuid($::fqdn) - - The generated UUID will be the same for the given hostname - - The resulting UUID is returned on the form: - - 1d839dea-5e10-5243-88eb-e66815bd7d5c - - (u.e. without any curly braces.) - - The generated UUID is a version 5 UUID with the V5 DNS namespace: - - 6ba7b810-9dad-11d1-80b4-00c04fd430c8 - - This only supports a the V5 SHA-1 hash, using the DNS namespace. - - Please consult http://www.ietf.org/rfc/rfc4122.txt for the details on - UUID generation and example implementation. - - No verification is present at the moment as whether the domain name given - is in fact a correct fully-qualified domain name. Therefore any arbitrary - string and/or alpha-numeric value can subside for a domain name. + @example Example Usage: + fqdn_uuid('puppetlabs.com') # Returns '9c70320f-6815-5fc5-ab0f-debe68bf764c' + fqdn_uuid('google.com') # Returns '64ee70a4-8cc1-5d25-abf2-dea6c79a09c8' DOC raise(ArgumentError, 'fqdn_uuid: No arguments given') if args.empty?