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%2Fvalidate_ip_address.rb;h=3fd582b0e6c52972aa287ad3fa40f3b1fd84be03;hp=af835adf0850e821e72cada43b671b5101d100d1;hb=30caaa85aed7015ca0d77216bff175eebd917eb7;hpb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f diff --git a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_ip_address.rb b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_ip_address.rb index af835adf0..3fd582b0e 100644 --- a/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_ip_address.rb +++ b/3rdparty/modules/stdlib/lib/puppet/parser/functions/validate_ip_address.rb @@ -3,22 +3,30 @@ # module Puppet::Parser::Functions newfunction(:validate_ip_address, :doc => <<-DOC - Validate that all values passed are valid IP addresses, - regardless they are IPv4 or IPv6 - Fail compilation if any value fails this check. - The following values will pass: - $my_ip = "1.2.3.4" - validate_ip_address($my_ip) - validate_ip_address("8.8.8.8", "172.16.0.1", $my_ip) - - $my_ip = "3ffe:505:2" - validate_ip_address(1) - validate_ip_address($my_ip) - validate_ip_address("fe80::baf6:b1ff:fe19:7507", $my_ip) - - The following values will fail, causing compilation to abort: - $some_array = [ 1, true, false, "garbage string", "3ffe:505:2" ] - validate_ip_address($some_array) + @summary + Validate that all values passed are valid IP addresses, + regardless they are IPv4 or IPv6 + Fail compilation if any value fails this check. + + @return + passes when the given values are valid IP addresses or raise an error when they are not and fails compilation + + @example **Usage** + The following values will pass: + + $my_ip = "1.2.3.4" + validate_ip_address($my_ip) + validate_ip_address("8.8.8.8", "172.16.0.1", $my_ip) + + $my_ip = "3ffe:505:2" + validate_ip_address(1) + validate_ip_address($my_ip) + validate_ip_address("fe80::baf6:b1ff:fe19:7507", $my_ip) + + The following values will fail, causing compilation to abort: + + $some_array = [ 1, true, false, "garbage string", "3ffe:505:2" ] + validate_ip_address($some_array) DOC ) do |args|