I'm trying to extend the standard 'user' type to add maintenance of some of 
the contents of a user's home directory, and I'm trying to avoid creating 
an entirely new custom type if I can.  The approach I'm taking is to create 
a site::user defined type which in turns calls the standard user type.  I'm 
having a problem figuring out how to manage the optional parameters.  

The most likely path seems to be something like this (simplified for 
example):

define site::user (
        $comment,
        $ensure,
        $home,
        $name = $title,
        $password,
    ) {

    user { "$title":
        comment => $comment,
        ensure => $ensure,
        home => $home,
        name => $name,
        password => $password,
    }
}

The problem with this, of course, is that the parameters to site::user 
aren't optional, and I'd like them to be.  I've tried setting their 
defaults to null strings, but I get errors about reassigning variables if I 
do that.  

Of course, this would be even better.. but doesn't appear to be a valid 
syntax in puppet:

define site::user ( $**args ) {
   user { "$title":
      $args
   }
}

This seems to me to be the sort of thing that'd be in a puppet cookbook, 
but google hasn't shown me any useful docs or examples for what I'm trying 
to do.  Does this approach even make sense, or is there a better way?

-- 
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.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to