Skip to content

ccin2p3/puppet-etc_services

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

etc_services

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

Overview

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

Setup

What etc_services affects

Entries in the /etc/services file.

Setup Requirements

Just declare an instance.

Usage

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',
}

Reference

See the references file.

Data Types

Etc_services::Protocols

A simple hash mapping udp, tcp, or both to specific ports.

tcp: 88
udp: 88
{
  tcp => 88,
  udp => 88,
}

Etc_services::ServiceName

Entries match the service naming standards laid out in RFC 6335 section 5.1.

Limitations

  • This module could be used on any operating systems that use the /etc/services file.
  • Only TCP and UDP protocols are supported!

Development

If you want to contribute or adjust some of the settings / behavior, either:

  • create a new Pull Request.

Contributors

Check out the contributor list.