Hi, > Sorry, just so I'm clear. > > You want create a user and a user group, and then add that user to an > sshuser group?
Yes. I want the user and users group to be always created. And the user added to the sshusers group only when the sshusers group exists (which happens when Puppet installs the SSH server package). > Can you create the user with all those groups by default? I don't see why > it has to be so complicated unless you have something really specific > you're trying to do. Of course I can. :) I am just trying to complicate things so I learn more of Puppet that way. My initial attempts at doing it were by creating the groups on all machines and adding the user to that group on all machines, but once I got the hang of things and wanted to try more complicated stuff I thought why not try this. > If you want to make it more complicated I would add something like: > > users.pp > .... > if Class[sshclassname] { > $groups = "sshusers" > ... > groups => $groups > ... > } > > Where you would declare the ssh class for the node then test for the > declaration when you create the user. You can also use a selector if you > like. Cool! Thanks for that. Hadn't realized it was possible to test whether a class is included. That would do the trick. In the syntax above, I take it you meant: if defined(Class[sshclassname]) { ... } instead of if Class[sshclassname] { ... } > Not sure if this is best practice though, but easier than custom facts or > execs. Definitely! Thanks for the suggestion. Regards, Rakhesh -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. 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.