From 9680d6ae06ee682a5117d3bedbcdd06f142f16ad Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 9 Sep 2019 22:19:20 +0200 Subject: [PATCH] authorized_key_add: allow undef value for key --- modules/ssh/manifests/authorized_key_add.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ssh/manifests/authorized_key_add.pp b/modules/ssh/manifests/authorized_key_add.pp index 2165b0f0a..122a392d8 100644 --- a/modules/ssh/manifests/authorized_key_add.pp +++ b/modules/ssh/manifests/authorized_key_add.pp @@ -4,14 +4,14 @@ 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) { -- 2.20.1