On Mon, Dec 5, 2011 at 3:31 AM, Sans <r.santanu....@gmail.com> wrote:
> Thanks Nigel! That works like a charm. But leaves me with one question > and another problem. First the question: If I always need to specify > the varable like "$zmfs::settings::l_dir", then waht the significance > of the "include" statement (e.g. include zmfs::settings ) in the > beginning of the manifest? > Including the class is what will cause the manifests in that class to be evaluated. Does that help? > > Now the problem is: If I define "env_check" inside a > 'class' (envcheck.pp in my example code above) and specify "include > zmfs::envcheck" in the config.pp, I get this error: > Make sure the names are the same. e.g. a define called "zmfs::envcheck" should be in $modulepath/modules/zmfs/manifests/envcheck.pp It looks like you're mixing an extra underscore in there. If you're doing this with a *define*, then you don't need to import or include that specific file. Just declare it in that location, and not inside a class. When you use that define, so long as the define is found in a path like the one above where the autoloader will find it, you don't need to import or include "zmfs::envcheck" anywhere. > > ------------------------- > err: Could not retrieve catalog from remote server: Error 400 on > SERVER: Puppet::Parser::AST::Resource failed with error ArgumentError: > Invalid resource type line_check at /etc/puppet/modules/zmfs/manifests/ > config.pp:94 on node farm002.. .. ..ac.uk > ------------------------- > > It only works if the envcheck.pp like this way: > > > ------------------------ > # /modulepath/modules/zmfs/manifests/envcheck.pp: > > define env_check($file, $string, $swdir, $refreshonly = 'true') { > ...... > ...... > } > ------------------------ > > (i.e. without having a class) and use "import envcheck.pp", instead > of: include zmfs::envcheck in the manifest. Does any one know what's > going wrong? > > Cheers, > San > > > > > > You want to use $zmfs::settings::l_dir > > > > You're fully qualifying the variable, so you need the "full path" to it, > > including the name of the module it lives in. > > > > -- > > Nigel Kersten > > Product Manager, Puppet Labs > > -- > 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+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/puppet-users?hl=en. > > -- Nigel Kersten Product Manager, Puppet Labs -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.