We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6cd15c6 commit 158f179Copy full SHA for 158f179
1 file changed
lib/puppet/functions/stdlib/ip_in_range.rb
@@ -4,7 +4,8 @@
4
# stdlib::ip_in_range('10.10.10.53', '10.10.10.0/24') => true
5
Puppet::Functions.create_function(:'stdlib::ip_in_range') do
6
# @param [String] ipaddress The IP address to check
7
- # @param [Variant[String, Array]] range One CIDR or an array of CIDRs defining the range(s) to check against
+ # @param [Variant[String, Array]] range One CIDR or an array of CIDRs
8
+ # defining the range(s) to check against
9
#
10
# @return [Boolean] True or False
11
dispatch :ip_in_range do
@@ -13,9 +14,9 @@
13
14
return_type 'Boolean'
15
end
16
- def ip_in_range(ipaddress, range)
17
- require 'ipaddr'
+ require 'ipaddr'
18
19
+ def ip_in_range(ipaddress, range)
20
ip = IPAddr.new(ipaddress)
21
22
if range.is_a? Array
0 commit comments