If we do not have a fact, notify out early
authorPeter Palfrader <peter@palfrader.org>
Sat, 7 Sep 2019 21:09:20 +0000 (23:09 +0200)
committerPeter Palfrader <peter@palfrader.org>
Sat, 7 Sep 2019 21:09:20 +0000 (23:09 +0200)
modules/ssh/manifests/keygen.pp

index 7f01020..29fd063 100644 (file)
@@ -4,8 +4,7 @@ define ssh::keygen(
 ) {
   if $facts["${user}_user_exists"] == undef {
     notify{"We do not have facters for user ${user} existance and keys -- add it to modules/debian_org/lib/facter/roleaccounts.rb": }
-  }
-  if $facts["${user}_user_exists"] {
+  } elsif $facts["${user}_user_exists"] {
     if ! $facts["${user}_key"] {
       exec { "create-${user}-ssh-key":
         command => @("EOF"),