Puppet Class: netbase

Defined in:
modules/netbase/manifests/init.pp

Summary

class to add a hash of service definitions to /etc/services

Overview

SPDX-License-Identifier: Apache-2.0

Parameters:

  • services (Hash[String,Netbase::Service]) (defaults to: {})

    a hash of Netbase::Service definitions

  • default_services (Hash[String,Netbase::Service]) (defaults to: {})

    a hash of Netbase::Service definitions

  • append_aliases (Boolean) (defaults to: false)

    if true append aliases to the preferred input

  • manage_etc_services (Boolean) (defaults to: true)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'modules/netbase/manifests/init.pp', line 6

class netbase (
    Hash[String,Netbase::Service] $services            = {},
    Hash[String,Netbase::Service] $default_services    = {},
    Boolean                       $append_aliases      = false,
    Boolean                       $manage_etc_services = true,
) {
    # we use the loose merge policy i.e. only test on port to ensure the default services always win
    $all_services = netbase::services::merge($services, $default_services, $append_aliases, false)
    if $manage_etc_services {
        file{'/etc/services':
            ensure  => 'file',
            owner   => 'root',
            group   => 'root',
            content => template('netbase/services.erb'),
        }
    }
}