Puppet Class: sys::ssh::service

Inherits:
sys::ssh::params
Defined in:
manifests/ssh/service.pp

Overview

Class: sys::ssh::service

Sets up the SSH service.

Parameters:

  • ensure (Any) (defaults to: 'running')
  • enable (Any) (defaults to: true)
  • service (Any) (defaults to: $sys::ssh::params::service)


5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'manifests/ssh/service.pp', line 5

class sys::ssh::service(
  $ensure  = 'running',
  $enable  = true,
  $service = $sys::ssh::params::service,
) inherits sys::ssh::params {

  if $service {
    service { $service:
      ensure  => $ensure,
      enable  => $enable,
      require => Class['ssh::install', 'ssh::config'],
    }
  } elsif $::operatingsystem == 'OpenBSD' {
    # Use this to restart SSH on OpenBSD systems prior to 5.7,
    # which did not have `rcctl`.
    exec { 'openbsd-restart-sshd':
      command     => '/etc/rc.d/sshd restart',
      refreshonly => true,
      subscribe   => File[$sys::ssh::params::sshd_config],
    }
  }
}