Thanks Alan,
Yesterday, I did it exactly the same way and it is running fine. I hope this will be helpful for other puppet newbies too.

Am 24.03.2010 19:09, schrieb Alan Barrett:
On Mon, 22 Mar 2010, Farooque M Haris wrote:
class /*DevelopersManager */#Secondary Class 1
{
*$fileList* = "developerUserlist.txt"
*$group* = "users"
*$home *= "/home"

     include StaffManager
}

class /*AdminsManager */#Secondary Class 2
{
*$fileList* = "adminUserlist.txt"
*$group* = "staff"
*$home *= "/home"

     include StaffManager
}
Apart from the strange stars and slashes (which I guess are an attempt
at highlighting), this won't work because, no matter how many "include"
statements you have, each class is really included no more than once.
Whichever of the two "include StaffManager" lines happens to take effect
first will do what you expect (making those variables available for use
by the StaffManager class).  Whichever of the two "include StaffManager"
lines happens to take effect last will do nothing, because that the
StaffManager class will already have been included.

To do what I think you want, you need something like this:

     define StaffManager($filelist, $group, $home) {
        # do stuff with $filelist, $group, and $home
     }

     class DevelopersManager {
        StaffManager { "developers":
            filelist =>  "developerUserlist.txt",
             group =>  "users",
             home =>  "/home",
        }
     }

     class AdminsManager {
        StaffManager { "admins":
            filelist =>  "adminsUserlist.txt",
             group =>  "staff",
             home =>  "/home",
        }
     }

--apb (Alan Barrett)



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

Reply via email to