Hi all,
I'm currently experiencing an issue where a module cannot reference a class from another module.
Currently, I've got two modules, workstation and nfs and I'm attempting to use a class from the nfs module inside the workstation module, like so:
Workstation module:
class acme_inc::workstation {
# ensure the local acme user exists
user { "acme":
ensure => present,
uid => '1234',
gid => 'acme',
shell => '/bin/bash',
home => '/home/$user_name',
managehome => true,
}
... SNIP ...
# install and set up the nfs client
class {'nfs':
class = "client",
}
}
NFS Module:
class nfs ($class = 'client', $domain = '') {
# install the class specific packages
if $class == 'client' {
# install client NFS packages
package { 'nfs-common':
ensure => installed,
}
} else {
# install server NFS packages
package { 'nfs-kernel-server':
ensure => installed,
}
}
# make sure that idmapd is running
service { 'idmapd':
name => $service_name,
ensure => running,
enable => true,
subscribe => File['idmapd.conf'],
}
# generate and send the config file
file { 'idmapd.conf':
path => '/etc/idmapd.conf',
ensure => file,
require => Package['nfs-common'],
content => template("nfs/idmapd.conf.erb"),
}
}
Is what I intend to do something supported by puppet? or do I have to load the NFS module in the site manifest? Because my end goal is to create a module for each of my clients, where each module can then load say nginx::vhost to build that clients nginx virtual host.
That way my server entry in site.pp is just:
class {'ntp':
}
include client1
include client2
}
Again, is this possible in puppet, or do I have to scrap this idea and simply include all the client stuff inside the node definition?
Any advise would be appreciated.
Regards,
Daniel Sage