Version information
released Mar 12th 2018
This version is compatible with:
- Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2016.4.x
- Puppet >= 4.10.0 < 6.0.0
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'pmuller-ipset', '0.6.0'
Learn more about managing modules with a PuppetfileDocumentation
pmuller/ipset — version 0.6.0 Mar 12th 2018
ipset
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',
}
Reference
Limitations
- Only tested on RedHat-like Linux distributions
- IPv6 sets have not been tested yet
Changelog
See CHANGELOG
Development
See development
Thanks
This module is a fork of mighq/ipset, which was based on thias/ipset.
Changelog
0.6.0 (2018-03-13)
- Support Puppet 4 and Puppet 5
- Tested release
- Improved documentation
0.5.2 (2016-12-02)
- installation tuning
0.5.1 (2016-07-22)
- just code quality fixes
0.5.0 (2016-07-19)
- improved support for rhel 7 + service deps
- fix from pull request #10 & #13
- be more strict what we accept as params
- fix: actually do the removal
- if loading of set contents fail, fail puppet
- ipset::unmanaged support
0.4.1 (2016-06-16)
- fix lost return value in ipset_sync
0.4.0 (2016-05-27)
- do not collide with sysvinit service from pkg
0.3.3 (2016-04-14)
- whitespace cleanup - indentation
0.3.2 (2016-04-14)
- verbose output option
- trim whitespaces from start&end of config file when comparing
0.3.1 (2016-02-26)
- /32 and /128 entries fix
0.3.0 (2016-02-26)
- support for passing set content as an array
- using swap when changing set contents - solves iptables cooperation problems
- ability to not sync the runtime (in-kernel) state with configs
- ability to change only one of set options
- input cleanup for duplicates in set content
- better performance when checking for set existence
- config folder for debian changed to /etc/ipset.d
- other minor code & bug fixes
0.2.1 (2015-04-26)
- documentation update
0.2.0 (2015-04-26)
- code quality tuning
- usage examples added to README.md
- systemd service definition / centos7 support
0.1.0 (2015-01-23)
- initial module release
Dependencies
- puppetlabs/stdlib (>=4.24.0 <5.0.0)
- thrnio/ip (>=1.0.0 <2.0.0)
Copyright 2015-2016 Michael Zubac Copyright 2018 Philippe Muller Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with the License. A copy of the License is located at http://aws.amazon.com/apache2.0/ or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.