File: match_block.pp

package info (click to toggle)
puppet-module-saz-ssh 13.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 564 kB
  • sloc: ruby: 1,511; sh: 10; makefile: 7
file content (32 lines) | stat: -rw-r--r-- 905 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# @summary
#   Add match_block to ssh client config (concat needed)
#
# @param options
#   Options which should be set
#
# @param type
#   Type of match_block, e.g. user, group, host, ...
#
# @param order
#   Orders your settings within the config file
#
# @param target
#   Sets the target file of the concat fragment
#
define ssh::client::match_block (
  Hash                 $options = {},
  Ssh::ClientMatch     $type    = 'user',
  Integer              $order   = 50,
  Stdlib::Absolutepath $target  = $ssh::client::ssh_config,
) {
  if $ssh::client::use_augeas {
    fail('ssh::client::match_block() define not supported with use_augeas = true')
  } else {
    concat::fragment { "match_block ${name}":
      target  => $target,
      # same template may be used for ssh_config & sshd_config
      content => template("${module_name}/sshd_match_block.erb"),
      order   => 200+$order,
    }
  }
}