paul matthews
2009-Feb-19 16:52 UTC
[Puppet Users] Define statement not being recognised - or so it seems
I''m trying to understand the sequence of passing variables from a node
definition to a define statement and how its called by a class. In short my
understanding is that nodes.pp can contain variables (eg. zoneip=>a.b.c.d, )
which are referenced by a define statement ( eg. define zones::zone_instance
(zoneip=$zoneip) and the class statement calls the definition (class zones
{zones::zone_instance etc)
More specifically, I''m defining a solaris zone, following a combination
of
some tips in a previous posting and the apache virtual_hosts example in
"Pulling Strings" and for some reason my definition statement is not
being
recognised * "Could not find resource type zones::zone_instance*"
Here''s the set up:-
*
The node def in nodes.pp:-*
* node ''solhost'' {
include zones
zone_instance { "solzone":
zoneip => "10.20.1.89",
zonename => "ptc37551-03",
zonepath => "/zfs/ptc37551-03",
}
}*
within the zones modules directory:-
*modules/zones/manifests/init.pp*:-
*class zones {
zones::zone_instance { $zonename:
zoneip => "$zoneip",
zonename => "$zonename",
zonepath => "$zonepath",
}
}*
and the corresponding definition in
*modules/zones/manifests/ptczones.pp*:-
*define zones::zone_instance (zoneip=$zoneip,$zonename,$zonepath) {
$fullname = "$zonename.$domain"
zone { $zonename:
ip => "bnx0:$zoneip",
path => "$zonepath",
realhostname => "$fullname",
ensure => running,
}
}*
Running on the puppet client I get the following error
puppetd --test
*err: Could not retrieve catalog: Could not find resource type
zones::zone_instance at /etc/puppet/modules/zones/manifests/init.pp:7 on
node solhost
*
Any pointers would be great*
*
Thanks
Paul
--
Paul Matthews
----------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---
Peter Meier
2009-Feb-19 17:08 UTC
[Puppet Users] Re: Define statement not being recognised - or so it seems
> [...] > Running on the puppet client I get the following error > puppetd --test > *err: Could not retrieve catalog: Could not find resource type > zones::zone_instance at /etc/puppet/modules/zones/manifests/init.pp:7 on > node solhost > * > Any pointers would be great* > *you have to import ptczones.pp in the init.pp of the module. otherwise puppet won''t have parsed the define yet. cheers pete --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
paul matthews
2009-Feb-20 10:43 UTC
[Puppet Users] Re: Define statement not being recognised - or so it seems
Pete,
Thanks very much. That was definitely one of the issues. The other seemed to
be that the node definition in nodes.pp needed to say
*zones::zone_instance { "solzone":* etc
rather than
*zone_instance { "solzone":*
thanks
Paul
2009/2/19 Peter Meier <peter.meier@immerda.ch>
> [...]
>> Running on the puppet client I get the following error
>> puppetd --test
>> *err: Could not retrieve catalog: Could not find resource type
>> zones::zone_instance at /etc/puppet/modules/zones/manifests/init.pp:7
on
>> node solhost
>> *
>> Any pointers would be great*
>> *
>>
>
> you have to import ptczones.pp in the init.pp of the module. otherwise
> puppet won''t have parsed the define yet.
>
> cheers pete
>
--
Paul Matthews
----------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com
To unsubscribe from this group, send email to
puppet-users+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---