- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with etc_services
- Usage
- Reference
- Data Types
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
- Contributors
Adds a defined type which can manage a specific service name in /etc/services
.
This module allows easy creation and removal of etc services entries via a new defined type. Each instance
Entries in the /etc/services
file.
Just declare an instance.
The etc_services
defined type allows a service to be instantiated with one or more port/protocol combinations.
etc_services { 'kerberos':
protocols => { 'udp' => '88' },
aliases => [ 'kerberos5', 'krb5', 'kerberos-sec' ],
comment => 'Kerberos v5',
}
The example above will generate a single entry in /etc/services
similar to the following:
kerberos 88/udp kerberos5 krb5 kerberos-sec # Kerberos v5
Note that the aliases and comment are entirely optional
Starting at release 2.0.0 the syntax of each etc_services entry changed subtly. Instead of encoding the protocol in the resource name, the port
parameter has been replaced with a hash of protocols
. This allows a service to be defined for two ports using the same resource.
Version < 2.0.0
etc_services { 'printer\tcp':
port => '515',
aliases => [ 'spooler' ],
comment => 'line printer spooler',
}
etc_services { 'printer\udp':
port => '515',
aliases => [ 'spooler' ],
comment => 'line printer spooler',
}
Version >= 2.0.0
etc_services { 'printer':
protocols => { 'tcp' => 515, 'udp' => 515 },
aliases => [ 'spooler' ],
comment => 'line printer spooler',
}
See the references file.
A simple hash mapping udp, tcp, or both to specific ports.
tcp: 88
udp: 88
{
tcp => 88,
udp => 88,
}
Entries match the service naming standards laid out in RFC 6335 section 5.1.
- This module could be used on any operating systems that use the
/etc/services
file. - Only TCP and UDP protocols are supported!
If you want to contribute or adjust some of the settings / behavior, either:
- create a new Pull Request.
Check out the contributor list.