On Sun, Feb 19, 2012 at 3:42 AM, Eslam Mamdouh
<emamdouh@cloud9ers.com>wrote:
> hi folks,
> As a response to " Dynamic lookup of $var at is deprecated. Support
will
> be removed in Puppet 2.8. Use a fully-qualified variable name (e.g.,
> $classname::variable) or parameterized classes." warning
>
> i''m trying to apply fully-qualified variable name solution
following this
> Doc http://docs.puppetlabs.com/guides/scope_and_puppet.html, but i have a
> problem with variable defined in nodes.pp as these variables are neither in
> top scope to use $::var nor in class to use $classname::variable
>
> So, any recommended suggestions regarding such these problems ?
>
You can''t use the following pattern:
node my_sys {
$var = ''value''
include app # <- uses $var.
}
You can update the class so it supports parameters:
class app (
$var,
) {
...
}
node my_sys {
class { ''app'':
var => ''value'',
}
}
or still use include and perform data lookup via something like hiera:
class app (
$var = hiera(''app_var'', ''some_default'')
) {
...
}
node my_sys {
include app
}
I think the last one will be most flexible.
HTH,
Nan
--
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.