ipset

Linux ipsets management

Vox Pupuli

puppet

4,896 downloads

2,708 latest version

5.0 quality score

Version information

  • 1.2.3 (latest)
  • 1.2.1
  • 1.2.0
  • 1.1.0
  • 1.0.0
released Mar 4th 2020
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x
  • Puppet >= 5.5.8 < 7.0.0
  • Debian
    ,
    Ubuntu
    ,
    RedHat
    ,
    CentOS
    ,
    OracleLinux
    ,
    Scientific
    ,
    VirtuozzoLinux
    , Archlinux

Start using this module

Documentation

puppet/ipset — version 1.2.3 Mar 4th 2020

puppet-ipset

Build Status Puppet Forge Puppet Forge - downloads Puppet Forge - endorsement Puppet Forge - scores

Table of Contents

Overview

This module manages Linux IP sets.

  • Checks for current ipset state, before doing any changes to it.
  • Applies ipset every time it drifts from target state, not only on config file change.
  • Handles type changes.
  • Autostart support for RHEL 6 and RHEL 7 family (upstart, systemd).

Usage

Array

IP sets can be filled from an array data structure. Typically passed from Hiera.

ipset { 'foo':
  ensure => present,
  set    => ['1.2.3.4', '5.6.7.8'],
  type   => 'hash:ip',
}

String

You can also pass a pre-formatted string directly, using one entry per line (with \n as a separator). This pattern is practical when generating the IP set entries using a template.

ipset { 'foo':
  ensure => present,
  set    => "1.2.3.4\n5.6.7.8",
  type   => 'hash:ip',
}

Module file

IP sets content can also be stored in a module file:

ipset { 'foo':
  ensure => present,
  set    => "puppet:///modules/${module_name}/foo.ipset",
}

Local file

Or using a plain text file stored on the filesystem:

file { '/tmp/bar_set_content':
  ensure  => present,
  content => "1.2.3.0/24\n5.6.7.8/32",
}

ipset { 'bar':
  ensure    => present,
  set       => 'file:///tmp/bar_set_content',
  type      => 'hash:net',
  subscribe => File['/tmp/bar_set_content'],
}

Reference

The module uses puppet-strings for documentation. The result is the REFERENCE.md file.

Limitations

  • Tested on Debian and RedHat-like Linux distributions
  • Only hash ipsets are supported (this excludes bitmap and list:set)

Changelog

See CHANGELOG

Development and Contribution

See development

Thanks

This module is a complete rewrite of sl0m0ZA/ipset, which is a fork of pmuller/ipset, which was forked from mighq/ipset, which was based on thias/ipset.