Hello Leam:

I think your looking for something like this:

-----------------------------

define sysusers::setup(
    $hash
) {
    

    case $::osfamily {
        'redhat': {
            $user_home = '/home'
        }
        'solaris': {
            $user_home = '/export/home'
        }
        'default': {
            $user_home = '/home'
        }
    }

    if(!defined(User[$name])) {
    user { $name :
        home         => "${user_home}/$hash[$name]['name'],
      ensure    => $hash[$name]['ensure'],
      comment    => $hash[$name]['comment'],
      expiry    => $hash[$name]['expiry'],
      gid            => $hash[$name]['gid'],
    }
  }
}

---------------------------------------

Let me know

Thanks
Joey

On Wednesday, February 11, 2015 at 3:31:01 PM UTC-5, leam hall wrote:
>
> Hey all, 
>
> I'm still getting stuck, and I've moved the case statement to several 
> places. The issue is the module's init.pp calls setup.pp. The user 
> data is stored in Hiera. So far I've tried: 
>
> 1. Going between $osfamily, $::osfamily, ${osfamily}, {$osfamily}, and 
> ${::osfamily}. The failures seem to be related to syntax, but I'm not 
> sure how to modify or place the case statement to meet syntax 
> requirements. 
>
> 2. I put the case in the init.pp file and had it set $_homedirbase. 
> Passed that to the call to create the user. Didn't work. 
>
> I'm mostly confused. 
>
> Leam 
> -- 
> Mind on a Mission 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/2e677496-53fb-4e4f-a11b-be448ca690e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to