23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
# File 'manifests/client.pp', line 23
class ssh::client (
String $ensure = present,
Boolean $storeconfigs_enabled = true,
Hash $options = {},
Boolean $use_augeas = false,
Array $options_absent = [],
) inherits ssh::params {
# Merge hashes from multiple layer of hierarchy in hiera
$hiera_options = lookup("${module_name}::client::options", Optional[Hash], 'deep', {})
$fin_options = deep_merge($hiera_options, $options)
if $use_augeas {
$merged_options = sshclient_options_to_augeas_ssh_config($fin_options, $options_absent, { 'target' => $ssh::params::ssh_config })
} else {
$merged_options = merge($fin_options, delete($ssh::params::ssh_default_options, keys($fin_options)))
}
include ssh::client::install
include ssh::client::config
# Provide option to *not* use storeconfigs/puppetdb, which means not managing
# hostkeys and knownhosts
if ($storeconfigs_enabled) {
include ssh::knownhosts
Class['ssh::client::install']
-> Class['ssh::client::config']
-> Class['ssh::knownhosts']
} else {
Class['ssh::client::install']
-> Class['ssh::client::config']
}
}
|