Version information
This version is compatible with:
- Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x
- Puppet >= 7.0.0 < 9.0.0
- , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'puppet-network', '2.2.1'
Learn more about managing modules with a PuppetfileDocumentation
Network module for Puppet
Overview
Manage non-volatile network and route configuration.
Usage
Interface configuration
network_config { 'eth0':
ensure => 'present',
family => 'inet',
method => 'dhcp',
onboot => 'true',
hotplug => 'true',
options => {'pre-up' => 'sleep 2'},
}
network_config { 'lo':
ensure => 'present',
family => 'inet',
method => 'loopback',
onboot => 'true',
}
network_config { 'eth1':
ensure => 'present',
family => 'inet',
ipaddress => '169.254.0.1',
method => 'static',
netmask => '255.255.0.0',
onboot => 'true',
}
Route configuration
Route resources should be named in CIDR notation. If not, they will not be properly mapped to existing routes and puppet will apply them on every run. Default routes should be named 'default'.
For Debian:
# default route
network_route { 'default':
ensure => 'present',
network => 'default',
netmask => '0.0.0.0',
gateway => '172.18.6.2',
interface => 'enp3s0f0',
}
# specific route
network_route { '172.17.67.0/24':
ensure => 'present',
gateway => '172.18.6.2',
interface => 'vlan200',
netmask => '255.255.255.0',
options => 'table 200',
}
For RedHat Enterprise:
network_route { '172.17.67.0/24':
ensure => 'present',
gateway => '10.0.2.2',
interface => 'eth0',
netmask => '255.255.255.0',
network => '172.17.67.0',
options => 'table 200',
}
network_route { 'default':
ensure => 'present',
gateway => '10.0.2.2',
interface => 'eth0',
netmask => '0.0.0.0',
network => 'default'
}
network_route { '10.0.0.2':
ensure => 'present',
network => 'local',
interface => 'eth0',
options => 'proto 66 scope host table local',
}
For SLES:
network_route { 'default':
ensure => 'present',
gateway => '10.0.2.2',
interface => 'eth0',
netmask => '0.0.0.0',
network => 'default'
}
Create resources on the fly with the puppet resource
command:
root@debian-6:~# puppet resource network_config eth1 ensure=present family=inet method=static ipaddress=169.254.0.1 netmask=255.255.0.0
notice: /Network_config[eth1]/ensure: created
network_config { 'eth1':
ensure => 'present',
family => 'inet',
ipaddress => '169.254.0.1',
method => 'static',
netmask => '255.255.0.0',
onboot => 'true',
}
# puppet resource network_route 23.23.42.0 ensure=present netmask=255.255.255.0 interface=eth0 gateway=192.168.1.1
notice: /Network_route[23.23.42.0]/ensure: created
network_route { '23.23.42.0':
ensure => 'present',
gateway => '192.168.1.1',
interface => 'eth0',
netmask => '255.255.255.0',
options => 'table 200',
}
Dependencies
This module requires the FileMapper mixin, available at https://github.com/voxpupuli/puppet-filemapper. The network_config type requires the Boolean mixin, available at https://github.com/adrienthebo/puppet-boolean.
The debian routes provider requires the package ifupdown-extra.
ifupdown-extra
can be installed automatically using the network
class.
To use it, include it like so in your manifests:
include 'network'
This class also provides fine-grained control over which packages to install and how to install them. The documentation for the parameters exposed can be found here.
Bonding on Debian requires the package ifenslave, which is installed automatically when a bond is defined. This package was renamed in Debian 9, and therefore bonding does not work on Debian versions prior to 9.
Note: you may also need to update your master's plugins (run on your puppet master):
puppet agent -t --noop
Or on puppet 3.8.7/4.x:
puppet plugin download
Contact
- Source code: https://github.com/voxpupuli/puppet-network
- Issue tracker: https://github.com/voxpupuli/puppet-network/issues
Changelog
All notable changes to this project will be documented in this file. Each new release typically also includes the latest modulesync defaults. These should not affect the functionality of the module.
v2.2.1 (2024-10-21)
Fixed bugs:
- Ensure boolean properties munged #335 (treydock)
- network_config::redhat: allow "_" in network interface names #331 (olifre)
v2.2.0 (2024-01-22)
Implemented enhancements:
Closed issues:
- installation of ifenslave during configuring bond fails on Debian >=11 #305
Merged pull requests:
- add EL8 Support and add missing EL flavours #316 (SimonHoenscheid)
- Add Debian 11 and 12 support #308 (hbog)
v2.1.0 (2023-12-01)
Implemented enhancements:
Merged pull requests:
v2.0.0 (2023-10-15)
Breaking changes:
- Drop Puppet 6 support #298 (bastelfreak)
Implemented enhancements:
- Increased kmod dependency to \< 5.0.0 #311 (canihavethisone)
- Add Puppet 8 support #303 (bastelfreak)
- puppetlabs/stdlib: Allow 9.x #302 (bastelfreak)
- Add SLES support to network_route and network_config types #301 (laugmanuel)
Fixed bugs:
- Removed deprecated and unused puppet-boolean dependency #310 (canihavethisone)
Closed issues:
- Support for SLES #300
v1.1.0 (2023-04-07)
Closed issues:
- The 'options' property of the network_route type doesn't do anything #295
v1.0.2 (2023-04-06)
Implemented enhancements:
- Allow for setting 'options' in network_route on RHEL-like OS's #294 (natemccurdy)
- Replace the IPAddress gem with the built-in IPAddr class #290 (imp-)
Closed issues:
- Unable to set correct netmask for IPv6 #267
Merged pull requests:
- puppet-lint: autofix #291 (bastelfreak)
v1.0.1 (2022-05-20)
Fixed bugs:
v1.0.0 (2022-05-06)
Fixed bugs:
- Change netmask to cidr for redhat/centos #209
- Redhat route provider unable to parse new format of route file #169
- Setup routes a CIDR, not full subnetmask #282 (oniGino)
Closed issues:
- unable to set /32 route #281
v0.10.1 (2021-10-28)
Fixed bugs:
- Puppet facts not populating after 61b10ea7fc1861bd334f14aad456d3027592e68f #274
- Don't prefix facts with
:
#278 (bastelfreak)
v0.10.0 (2021-09-17)
Breaking changes:
- Drop Puppet 4/5 support #272
- Drop EoL CentOS 6 support #273 (bastelfreak)
Implemented enhancements:
- update version dependencies for boolean and filemappper #237
- support non numerical aliases on redhat #255 (LadyNamedLaura)
Fixed bugs:
Closed issues:
Merged pull requests:
- Allow stdlib 8.0.0 #275 (smortex)
- modulesync 4.2.0 & puppet-lint updates #268 (bastelfreak)
- Switch to rspec for testing. #266 (KeithWard)
- Use confine to ensure
ip
is available for network fact #265 (runejuhl) - Remove duplicate CONTRIBUTING.md file #259 (dhoppe)
- Bump version requirements for stdlib/Puppet #256 (runejuhl)
- Get rid of all raise_error warnings in the tests and align errors a bit #252 (vStone)
- Stop using $::osfamily but use $facts['osfamily'] #251 (vStone)
- allow puppetlabs/stdlib 5.x #247 (bastelfreak)
- Remove docker nodesets #244 (bastelfreak)
- drop EOL OSs; fix puppet version range #243 (bastelfreak)
- bump puppet to latest supported version 4.10.0 #241 (bastelfreak)
- #237: increase version boundary for boolean and filemapper dependencies #238 (kevpfowler)
- Remove EOL operatingsystems #234 (ekohl)
v0.9.0 (2017-11-13)
Merged pull requests:
v0.8.0 (2017-07-04)
Implemented enhancements:
- BREAKING: replace validate_integer with datatype & drop puppet3 support #220 (bastelfreak)
Fixed bugs:
- Malformed debian interfaces file error when running puppet daemon #60
Closed issues:
- Package[ipaddress]: Provider gem is not functional on this host #215
- puppet-boolean module not available anymore via puppetforge #213
Merged pull requests:
- prepare release: 0.8.0 #228 (igalic)
- Fix github license detection #226 (alexjfisher)
- update gem provider for 4.x #216 (igalic)
v0.7.0 (2017-01-12)
Merged pull requests:
- release 0.7.0 #211 (bastelfreak)
- Set min version_requirement for Puppet + bump deps #208 (juniorsysadmin)
- Fix
mock_with
in.sync.yml
#202 (alexjfisher) - Use Facter 3 if available for some facts #200 (rski)
- rubocop: fix RSpec/ImplicitExpect #196 (alexjfisher)
- Add missing badges #195 (dhoppe)
v0.6.1 (2016-09-27)
Merged pull requests:
- Fix name of filemapper dependency. #188 (johanek)
- Make fact confinement ruby 1.8 compatible #187 (alexjfisher)
v0.6.0 (2016-09-16)
Implemented enhancements:
- ifupdown-extras required on Debian, but not installed #45
- Deprecate/Remove :family property, add :ip6address property, add :ipv6 and :ipv4 features #16
- Add a
network
class which installs the packages and gems required by #168 (rski)
Fixed bugs:
- Multiple interfaces with different families not supported #9
- The interfaces provider does not support mapping sections #3
Closed issues:
- Allow setting every possible option without using the options hash #166
- undefined method `with_env' for Facter::Util::Resolution:Class #162
- innitial creation of debian routes sets options as
absent
#160 - support for IPv6 routes #158
- Clear-up documentation for then network plugin #154
- Not clear where the ipaddress gem should be installed #152
- RedHat routes provider puts 'absent' in the files #149
- Git information is included in tar.gz #124
- network _route error on oralinux(redhat) #104
- make a fresh release of this module #102
- cannot add ipv6 address on debian #92
- /etc/network/routes updated on every run #69
- Reconfigure option does not work #68
- Readme.md: network_route requires 'network' parameter #53
- Add validation for type values #7
Merged pull requests:
- replace explicit symlinks with an autogenerated ones #183 (igalic)
- Support for MTU on bonds. #182 (vholer)
- Unfudge
writes 5 fields
test #178 (alexjfisher) - Remove with_env, and trust in PATH being correct #177 (igalic)
- Fix a typo in the HEADER of generated files #170 (roman-mueller)
- Fix issue 69, backwards incompatible change #165 (rski)
- fix "absent" options #161 (igalic)
- routes: add ability to parse IPv6 addresses #159 (igalic)
- Don't write absent to redhat route files and test for this #157 (rski)
- soft fail on missing ipaddress gem #155 (fraenki)
- Update README to better reflect the current module state #150 (rski)
v0.5.0 (2016-03-14)
Closed issues:
- Malformed redhat files are generated #142
- make module rubocop clean #141
- provider on CentOS 6 #135
- require 'ipaddress' breaks puppet runs #129
- ipaddress gem requirement missing from readme #128
- Travis CI lockup #127
- vlan regex misses MANY 1000-3000, and vlans ending in [6-9] above 4000. #116
- Failing to create dummy0 device on RHEL6 #115
- Interface config created but device is not up #86
- Interfaces are "created" every puppet run #42
Merged pull requests:
- Update metadata.json, CHANGELOG for the 0.5.0 release #148 (rski)
- rubocop fixes, split a really long line #144 (rski)
- Make :absent attributes not get written to redhat files #143 (rski)
- Guard against :absent provider.options in redhat (issue 115) #140 (rski)
- Ignore new Debian Jessie's features #133 (vide)
- Mention the ipaddress gem requirement in the docs #130 (rski)
- Fix network facts on Gentoo #126 (saz)
- Allow an empty hash for options #123 (derekhiggins)
- updated version for module dependency camptocamp/kmod #122 (dustyhorizon)
- Setup extra files for travis releases #120 (igalic)
- travis fixes: introduce augeasversion fact #119 (igalic)
- "fix" travis tests by installing the latest version of augeas #118 (igalic)
- Fix vlan match bug per https://github.com/puppet-community/puppet-net… #117 (robbat2)
- Contain instead of deprecated include #113 (JimPanic)
- Fix test runs by using strings as cases for $::osfamily #112 (JimPanic)
- Do not try to build Puppet 4 with Ruby 1.8.7 #110 (JimPanic)
- Actually use the env variable set in .travis.yml #109 (JimPanic)
- Release version 0.5.x in the puppet-community namespace #106 (ffrank)
- Bond improvements #95 (vholer)
- Set mode "raw" to existing non-VLAN interfaces on Debian #94 (vholer)
- On Debian write only non-empty auto/allow-hotplug interface parameters #93 (vholer)
- Update links to travis #91 (ekohl)
- Use ifcfg script name in case DEVICE parameter is not specified on redhat network_config provider #90 (stzilli)
- Fix: do not print properies if they are absent. #84 (jordiclariana)
- indent sub-entries to the in interfaces #82 (igalic)
- remove network_public_ip fact #81 (igalic)
- RHEL7/ CentOS7: adapt ifcfg detection to new device naming scheme #76 (Xylakant)
- Add additional option support #74 (dblessing)
- Fixed failing network::bond test #72 (aelsabbahy)
- Ommit lacp_rate for non 802.3ad mode #67 (jskarpe)
- Two fixes for RedHat: #57 (jasperla)
- Interface mode property #56 (jhoblitt)
- Fix for issue #43 #52 (wolfspyre)
- added link to debian package ifupdown-extra #51 (c33s)
- ensure that network_config redhat provider flushed files have a consiste... #49 (jhoblitt)
- Redhat provider tagged interfaces #47 (jhoblitt)
- Interface mtu property #46 (jhoblitt)
- Fix file expansion problem with PE. #40 (nanliu)
0.4.2 (2015-06-18)
Closed issues:
- Push a new version to the forge #103
- Add support for
--tcp-mss
option #100 - network_config redhat provider fails in case DEVICE parameter is not present in ifcfg-* file #89
- Provider not working on Ubuntu 14.04 LTS ? #88
- no support for pointopoint and gateway #83
- Vagrant + Puppet #80
- It runs but doesn't do anything on the agent #79
- create option to overwrite /etc/network/interfaces explicitly #78
- Remove dependencies #71
- Could not autoload network_config #70
- setting the default route on Debian #61
- default network example does not work on RHEL #58
- network_* facts don't work on OpenVZ #43
- bond config in CentOS 6 work with this #32
- rspec failures on RHEL6 #30
0.4.1 (2013-08-18)
Closed issues:
- Skip munge in full netmask addresses #54
- Unable to find property, Puppet 3.2.3 #50
- Support ONPARENT option for aliases #41
- No longer finding interface config scripts in CentOS #39
- Bogus error - Could not evaluate: Unable to support multiple interfaces in a single file #38
0.5.0-rc1 (2013-05-22)
Fixed bugs:
- umask for built module is broken #24
Closed issues:
- Network module responds poorly to ifcfg-NNN.bak files #36
- spec fixture files contain illegal path characters on Windows #33
- Facts for default interface #29
- Request for comments: static routing configuration #20
- No ipip tunnel support? Nor no IP alias support? #19
Merged pull requests:
0.4.0 (2013-03-23)
Closed issues:
- debian interfaces parser fails if two spaces are between 'iface' and the device #26
- Spec failures on redhat #25
0.3.0 (2013-01-30)
0.3.0-rc1 (2013-01-24)
Closed issues:
Merged pull requests:
- Add support for non-volatile network routes on Debian #23 (codec)
- Add dependency reference in README to boolean mixin #21 (robertstarmer)
0.2.0 (2013-01-06)
Implemented enhancements:
- The network_config type should have a :provider_options feature #2
- The network_config type should have a :reconfigurable feature #1
Closed issues:
- Redhat provider should be hotpluggable #15
0.2.0-rc1 (2012-12-30)
Fixed bugs:
- While configuration checked interface incorrectly marked as changed #13
Closed issues:
- Invalid value for method => loopback #10
0.1.1 (2012-12-07)
Fixed bugs:
- Spec failures on ruby 1.9.3 #14
0.1.0 (2012-12-04)
Fixed bugs:
- allow-hotplug section mangles interfaces file #11
Closed issues:
- Support hotplug configurations #12
0.1.0-rc1 (2012-11-27)
0.0.4 (2012-11-01)
Fixed bugs:
- The redhat provider has poor support for options with strings #5
Closed issues:
- network_config properties should be validated #8
- The redhat provider needs config \<-> resource munging #6
0.0.4rc1 (2012-10-28)
0.0.3 (2012-10-22)
0.0.3rc2 (2012-10-22)
0.0.3rc1 (2012-10-22)
0.0.2 (2012-10-16)
Fixed bugs:
- interfaces provider fails when given a second interface to manage #4
0.0.1 (2012-09-18)
0.0.1rc2 (2012-09-18)
0.0.1rc1 (2012-08-29)
* This Changelog was automatically generated by github_changelog_generator
Dependencies
- puppetlabs/stdlib (>= 4.13.1 < 10.0.0)
- puppet/filemapper (>= 2.0.1 < 5.0.0)
- puppet/kmod (>= 3.0.0 < 5.0.0)
Copyright 2012 Adrien Thebo Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS