If I remove the virtualization aspect then it works.  Any idea why that 
might stop the groups from being applied?


On Thursday, October 25, 2012 1:01:08 PM UTC-7, Ben McCann wrote:
>
> Hi,
>
> I'm trying to add a user to a group.  I've added the groups I would like 
> the user to appear in using the groups attribute:
>
>   @users::virtual::localuser { "myuser":
>     uid     =>      "3000",
>     groups  =>      [ "sudo", "adm", "mygroup", ],
>     sshkey  =>      "AAAA",
>   }
>
> I've defined localuser as:
>
> class users::virtual {
>
>   define localuser ($uid, $groups=[], $sshkey="") {
>     user { $title:
>       ensure     => "present",
>       uid        => $uid,
>       gid        => "users",
>       groups     => $groups,
>       shell      => "/bin/bash",
>       home       => "/home/$title",
>       comment    => $realname,
>       managehome => true,
>     }
>
>     ssh_authorized_key { $title:
>       ensure   => "present",
>       type     => "ssh-rsa",
>       key      => "$sshkey",
>       user     => "$title",
>       require  => User["$title"],
>       name     => "$title",
>     }
>   }
>
> }
>
>
> It seems to work for creating a new user, but if I add a new group the 
> user is not added to that group.  I can see that "mygroup" already exists 
> on the machine:
> $ grep mygroup /etc/group
> mygroup:x:200:
>
> Any ideas what I might be doing wrong?  I'm running Puppet 2.7.11 on 
> Ubuntu 12.04.
>
> Thanks,
> Ben
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/puppet-users/-/bVYPcqDPzdQJ.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to