>
>  
>
Here my init.pp
define useradd ( $name, $uid, $group, $gid, $password, $shell, $sshkeytype, 
$sshkey) {
   $homedir = $kernel ? {
      'SunOS' => '/export/home',
      default   => '/home'
   }
   $username = $title
   user { $username:
      ensure => present,
      comment => "$name",
      uid => "$uid",
      gid => "$gid",
      shell => "$shell",
      home => "$homedir/$username",
      managehome => true,
      password => "$password",
      require => group["$group"],
   }
   group { $group:
      gid => "$gid",
   }
   exec { $username:
      command => "/bin/cp -R /etc/skel $homedir/$username; /bin/chown -R 
$username:$group $homedir/$username ",
      creates => "$homedir/$username",
      require => user["$username"],
   }
   ssh_authorized_key { $username:
      user => "$username",
      type => "$sshkeytype",
      key => "$sshkey",
      require => exec["$username"],
   }
}

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to