Forge Home


CC-IN2P3 module for managing /etc/services entries


2,489 latest version

5.0 quality score

Version information

  • 2.0.3 (latest)
  • 2.0.0
  • 1.1.1
  • 1.1.0
  • 1.0.2
  • 1.0.0
released Sep 16th 2021
This version is compatible with:
  • Puppet Enterprise 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 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, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 4.7.0 < 8.0.0
  • RedHat, Scientific, CentOS, Debian, Ubuntu

Start using this module

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

Add this module to your Puppetfile:

mod 'ccin2p3-etc_services', '2.0.3'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add ccin2p3-etc_services
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install ccin2p3-etc_services --version 2.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.



ccin2p3/etc_services — version 2.0.3 Sep 16th 2021


Build Status Version

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with etc_services
  4. Usage
  5. Reference
  6. Data Types
  7. Limitations - OS compatibility, etc.
  8. Development - Guide for contributing to the module
  9. Contributors


Adds a defined type which can manage a specific service name in /etc/services.

Module Description

This module allows easy creation and removal of etc services entries via a new defined type. Each instance


What etc_services affects

Entries in the /etc/services file.

Setup Requirements

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

Conversion from 1.x.x Releases

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.

Data Types


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.