Forge Home

ip_in_range

A Puppet function to determine if an IPv4 address is within the given IPv4 CIDR

28,635 downloads

518 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.0.7 (latest)
  • 0.0.6
  • 0.0.5
  • 0.0.4
  • 0.0.3
  • 0.0.2
released Nov 27th 2015
This version is compatible with:
  • RedHat, Ubuntu, Debian, Fedora, CentOS

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'deanwilson-ip_in_range', '0.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add deanwilson-ip_in_range
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install deanwilson-ip_in_range --version 0.0.3

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

deanwilson/ip_in_range — version 0.0.3 Nov 27th 2015

puppet-ip_in_range

A Puppet function to determine if an IPv4 address is within the IPv4 CIDR

ip_in_range returns true if the ipaddress is within the CIDR

usage: ip_in_range(<IPv4 Address>, <IPv4 CIDR>)

There are a couple of commonly used patterns -

$valid_ip = ip_in_range('10.10.10.53', '10.10.10.0/24') # $valid_ip == true

or using the check as part of a conditional -

if ip_in_range($ipaddress, '10.10.200.0/24') == true {
  notify { 'Do subnet based resources here': }
}

It has a dependency on puppetlabs-stdlib to work.

License

Apache 2.0 - Dean Wilson