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 33 34 35 36
|
# @summary
# Internal define to managed ssh server param
#
# @param key
# Key of the value which should be set
#
# @param value
# Value which should be set
#
# @param order
# Orders your setting within the config file
#
define ssh::server::config::setting (
String[1] $key,
Variant[Boolean, Array, Hash, String] $value,
Variant[String[1], Integer] $order = '10'
) {
contain ssh::server
$real_value = $value ? {
Boolean => $value ? {
true => 'yes',
false => 'no',
default => undef
},
Array => join($value, ' '),
Hash => fail('Hash values are not supported'),
default => $value,
}
concat::fragment { "ssh_setting_${name}_${key}":
target => $ssh::server::sshd_config,
content => "\n# added by Ssh::Server::Config::Setting[${name}]\n${key} ${real_value}\n",
order => $order,
}
}
|