Good morning everyone,
I'm trying my hand with subclasses and using parametrized (sub-)classes.
Here's the module layout, and what I'm trying to acheive:
*/etc/modules/users/manifests/sysadmins.pp*
class users::sysadmins
{
realize (Group['sysadmins'])
include users::sysadmins::jfg1
include users::sysadmins::jfg2
}
and then I'd have, in */etc/modules/users/manifests/sysadmins/jfg1.pp* :
class users::sysadmins::jfg1
{
@user { 'jfg1' :
comment => 'JFG1 test accnt',
ensure => present,
gid => 'sysadmins',
[snip]
}
realize (User['jfg1'])
}
Now, I'd want some common files to be put into $HOME, regardless of the
user being created. I've thought of adding this:
*/etc/puppet/modules/users/sysadmins/commonfiles.pp* :
class users::sysadmins::commonfiles($homedirectory, $username)
{
file { "${homedirectory}/.profile" :
ensure => present,
owner => "${username}",
group => 'sysadmins',
source =>
"puppet:///modules/users/profiles/${username}-profile",
}
[snip]
}
($homedirectory has to be explicitely passed to this module because $HOME
could be /export/home, /home/ or other combinations -> /Users/$user on OSX,
for instance)
Now, back to /etc/modules/users/manifests/sysadmins/jfg1.pp, right after
the realize User[] line, I'd call the commonfiles subclass with:
include users::sysadmins::commonfiles("/export/home/jfg1", "jfg1")
Except that I get this error:
Error: Unknown function users::sysadmins::commonfiles at
/etc/puppet/modules/users/manifests/sysadmins/jfg1.pp:61 on node XXX
I'm not sure of what am I missing here.
Any pointers ?
Regards,
--Jeff
--
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/301de384-21df-4e27-b899-71ba865ff00e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.