I'm trying to modify certain users, created with by calling the define
users::local.
I tried to do it, by calling users::local::modify - but then puppet
complains that only subclasses may modify.. :(
What am I doing wrong here?
Code:
define users::local
($uid,$gid,$realname,$groups=[],$pass='',$sshkey="",$shell="/bin/bash",$home="/home/$title")
{
user { $title:
ensure => "present",
uid => $uid,
gid => $gid,
groups => $groups,
shell => $shell,
home => $home,
comment => $realname,
password => $pass ? {
'' => undef,
default => $pass
},
managehome => true,
}
if ( $sshkey != "" ) {
ssh_authorized_key { $title:
ensure => "present",
type => dsa,
key => "$sshkey",
user => "$title",
require => User["$title"],
name => "$title",
}
}
}
define users::local::modify
($uid='',$gid='',$realname='',$groups=[],$pass='',$sshkey="",$shell="/bin/bash",$home="/home/$title")
{
if ( ! empty($groups) ) {
User[$title] { groups => $groups }
}
}
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/77b419a4-e8da-42e8-921e-72156b1816ba%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.