Puppet Class: os_hardening::services

Defined in:
manifests/services.pp

Overview

Class: os_hardening::services

Configures specific services that do not require a full class of their own

Parameters:

  • unwanted_packages (Array) (defaults to: [])
  • wanted_packages (Array) (defaults to: [])
  • disabled_services (Array) (defaults to: [])


18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'manifests/services.pp', line 18

class os_hardening::services (
  Array   $unwanted_packages = [],
  Array   $wanted_packages   = [],
  Array   $disabled_services = [],
) {
  # Remove packages that should not be installed
  $unwanted_packages.each |String $package| {
    package { $package:
      ensure => purged,
    }
  }

  # Add packages that should be installed
  $wanted_packages.each |String $package| {
    package { $package:
      ensure => installed,
    }
  }

  # Disable services that are not wanted
  $disabled_services.each |String $service| {
    service { $service:
      ensure => stopped,
      enable => false,
    }
  }
}