define ssh::authorized_key_add(
String $target_user,
String $command,
- String $key,
+ Variant[String, Undef] $key,
Variant[Array[String], String] $collect_tag,
String $restrict = 'restrict',
Array[Stdlib::IP::Address] $from_hosts = $base::public_addresses,
) {
$from = $from_hosts.join(',')
- if (size(split($key, "\n")) > 1) {
+ if ($key and size(split($key, "\n")) > 1) {
fail('More than one line in key for ssh::authorized_key')
}
if (size(split($command, '"')) > 1) {