Fix user::managed for earlier (<3.6) puppet agents
authorJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>
Thu, 4 Jun 2015 15:04:58 +0000 (11:04 -0400)
committerJerome Charaoui <jcharaoui@cmaisonneuve.qc.ca>
Thu, 4 Jun 2015 15:04:58 +0000 (11:04 -0400)
manifests/managed.pp

index 0b0d677..a0806e7 100644 (file)
@@ -78,9 +78,18 @@ define user::managed(
     shell          => $real_shell,
     groups         => $groups,
     membership     => $membership,
-    purge_ssh_keys => $purge_ssh_keys,
   }
 
+  if $purge_ssh_keys {
+    if versioncmp($::puppetversion, '3.6') >= 0 {
+      User[$name] {
+        purge_ssh_keys => true
+      }
+    }
+    else {
+      notice("Parameter purge_ssh_keys is unsupported in your Puppet agent!")
+    }
+  }
 
   if $managehome {
     file{$real_homedir: }