On Tuesday 06 Jul 2010 08:42:55 christopher floess wrote:
> Hi, quick question:
>
> I have been following the thread: "Splitting classes into separate
> files" and decided to to some refactoring based on that. I have the
> following file structure for a module
>
> modules/packages/manifests/init.pp
> modules/packages/manifests/classes/redis.pp
mv modules/packages/manifests/classes/redis.pp
modules/packages/manifests/redis.pp
>
> ~/puppet_config$ cat modules/packages/manifests/init.pp
> import "redis"
You can remove this.
> ~/puppet_config$ cat modules/packages/manifests/classes/redis.pp
> class redis {
> file {
> "/home/adva/builds/redis_1.02-1_i386.deb":
> ensure => present,
> source => "puppet:///redis/redis_1.02-1_i386.deb";
> }
>
> file {
> "/etc/redis.conf":
> ensure => present;
> }
>
> package {
> "redis":
> require => File["/home/adva/builds/redis_1.02-1_i386.deb"],
> source => "/home/adva/builds/redis_1.02-1_i386.deb",
> ensure => installed,
> provider => dpkg;
> }
> }
>
> then in manifests/modules.pp I have
>
> ~/puppet_config$ cat manifests/modules.pp
> # /etc/puppet/manifests/modules.pp
>
> import "base_packages"
> import "base_configs"
> import "users"
> import "sphinx"
> import "gems"
> import "ree"
> import "nginx"
> import "puppet_client"
> import "packages"
And 'import "packages"' here too. Autoloader should take care of that.
> puppet-ad...@servercharlie:~/puppet_config$
>
> and in manifests/nodes.pp, I have
> <--- snip --->
> node 'ext-b2c-sk-test' inherits default {
> include b2c_test
> include sk_base
> include gems_sk_all
> include gems_b2c_base
> include ree
> include packages::redis
That's correct.
> include nginx
> include sphinx
> adva_users{"application": username => "application",}
> }
> <--- snip --->
>
> I'm getting the error: Could not retrieve catalog from remote server:
> Error 400 on SERVER: Could not parse for environment production: No
> file(s) found for import of 'redis' at
> /home/puppet-admin/puppet_config/modules/packages/manifests/init.pp:2
>
> So my question is, how do I change things in the 4 files above so that
> this runs properly.
>
> Because of the auto-load stuff mentioned in Module standards, I've also
> tried changing 'include packages::redis" to 'include redis', but that
> didn't work either.
IIUC with autoloader you can basically think of it as: it takes class/define
name requested (e.g. from include line), converts it into a filename so, e.g.:
packages -> packages/manifests/init.pp
packages::redis -> packages/manifests/redis.pp
packages::foo::bar -> packages/manifests/foo/bar.pp
and looks that up in each dir in module path.
>
> Thanks in advance,
> Chris
--
Michael Gliwinski
Henderson Group Information Services
9-11 Hightown Avenue, Newtownabby, BT36 4RT
Phone: 028 9034 3319
**********************************************************************************************
The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee and access to the email by anyone else
is unauthorised.
If you are not the intended recipient, any disclosure, copying, distribution or
any action taken or omitted to be taken in reliance on it, is prohibited and
may be unlawful.
When addressed to our clients, any opinions or advice contained in this e-mail
are subject to the terms and conditions expressed in the governing client
engagement leter or contract.
If you have received this email in error please notify
[email protected]
John Henderson (Holdings) Ltd
Registered office: 9 Hightown Avenue, Mallusk, County Antrim, Northern Ireland,
BT36 4RT.
Registered in Northern Ireland
Registration Number NI010588
Vat No.: 814 6399 12
*********************************************************************************
--
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.