Puppet Function: ssh::add_sshd_config

Defined in:
functions/add_sshd_config.pp
Function type:
Puppet Language

Overview

ssh::add_sshd_config(String[1] $key, Any $value, Variant[Array[String[1]],Undef] $remove_keys, Array[Type[Catalogentry]] $resources_to_notify = [ Service['sshd'] ])Nil

Add a sshd_config entry if it is not in the remove list

Parameters:

  • key (String[1])

    The name of the sshd configuration parameter

  • value (Any)

    The value of the sshd configuration parameter

  • remove_keys (Variant[Array[String[1]],Undef])

    List of sshd configuration parameters to be removed

  • resources_to_notify (Array[Type[Catalogentry]]) (defaults to: [ Service['sshd'] ])

    Catalog resources to notify when the sshd configuration has changed

Returns:

  • (Nil)


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'functions/add_sshd_config.pp', line 11

function ssh::add_sshd_config(
  String[1]                       $key,
  Any                             $value,
  Variant[Array[String[1]],Undef] $remove_keys,
  Array[Type[Catalogentry]]       $resources_to_notify = [ Service['sshd'] ]
) {

  $_add = ( $remove_keys == undef ) or ( !member($remove_keys, $key) )

  if $_add {
    sshd_config { $key:
      value  => $value,
      notify => $resources_to_notify
    }
  }
}