Hi Johan,

thank you for the hint with virtual resources.
Here is my solution

cat init.pp 
class accounts {
   @accounts::virtual {'test1': 
      comment => "test1",
      uid => "1056",
      gid => "880",
      group => "baader",
      shell => "/bin/bash",
      password => '$1$6hsRON8i7w5JncJDROnjh51',
      sshkeytype => "rsa",
      sshkey => "",
   }

   @accounts::virtual {'test2':
      comment => "test2",
      uid => "1058",
      gid => "880",
      group => "baader",
      shell => "/bin/bash",
      password => '$1$RuV4YCYT$KXDWuNtU9B1',
      sshkeytype => "rsa",
      sshkey => "",
   }
}

cat virtual.pp 
define accounts::virtual ( $comment, $uid, $group, $gid, $password, $shell, 
$sshkeytype, $sshkey) {
   $username = $title

   group { $group:
      gid => "$gid",
      ensure => present,
   }

   user { $username:
      ensure => present,
      comment => "$comment",
      uid => "$uid",
      gid => "$gid",
      shell => "$shell",
      home => "/home/$username",
      managehome => true,
      forcelocal => true,
      password => "$password",
      require => Group["$group"],
   }

   ssh_authorized_key { $username:
      user => "$username",
      type => "$sshkeytype",
      key => "$sshkey",
      require => User["$username"],
   }
}

node 'vm6741.muc.baag' inherits base {
   include accounts
   realize (Accounts::Virtual['test2'])
}

Best regards
Andreas


-- 
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