On Jun 23, 6:38 am, Joe McDonagh <[email protected]> wrote:
> On 06/22/2010 08:32 PM, tehcook wrote:
>
> > Hi
>
> > New to the puppet. I'm trying to make a user management module
> > "users", which has one definition and a bunch of classes. Here is my
> > structure under $modulepath :
>
> > users/manifests/classes/evergent.pp
> > users/manifests/classes/admins.pp
> > users/manifests/classes/list.pp
> > users/manifests/classes/outside.pp
> > users/manifests/classes/dbas.pp
> > users/manifests/defines/account.pp
> > users/manifests/init.pp
>
> > Definition is :
>
> > define users::account($realname, $userid, $password) {
> > ....
> > }
>
> > It creates user, group, $HOME, adds user's public ssh key and chown -R
> > his whole $HOME
>
> > Then there is a class users::list that has all users like this :
>
> > �...@users::account { "root":
> > realname => "Root user",
> > userid => "1000",
> > password => "xxxxxxxxxxx",
> > }
>
> > The idea is that all users are defined as a "virtual definition" and
> > will be realized later.
>
> > Now there is class users:admins that has all sysadmins :
>
> > class users::admins {
> > realize Users::Account["root"]
> > }
>
> > Then in site.pp I import my "users" module :
>
> > import "users"
>
> > and in one of the nodes I include sysadmins :
>
> > node "host1.test.com" inherits "default" {
> > include users::admins
> > }
>
> > Now when I run puppetd -o -t -v on that node I get error :
>
> > err: Could not retrieve catalog from remote server: Error 400 on
> > SERVER: Failed to realize virtual resources Users::Account[root] on
> > node host1.test.com
>
> > Do I do something not supported by the puppet ? I understand everyone
> > suggests making virtual resource user and then realize them in the
> > class. But I want add some thing like chown -R $HOME, ssh keys and
> > more. Can I use virtual definition same way as virtual resources ?
> > What am I doing wrong ? Any pointers to something similar would help a
> > lot. I've checked "Pulling strings with Puppet" book but it does not
> > show any example of the virtual definitions like this.
>
> > Thanks
>
> Is that just an example or are you actually trying to make an account
> named root with uid 1000?
>
Of course this is just to replace real usernames with something
anynymous.
I actually figured out what was wrong - this was about putting
"classname::" in front of some things and wrapping define in class {}.
Had to tear apart whole thing and make a simple test module.
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.