Hello,
I want to access variable of a parameterized class but it fails with
"class has not been evaluated".
Tried to evaluate it first adding stages and requires, but still same.
I''ll explain better with an example:
stage { pre: before => Stage[main] }
class directory($path) {
file { $path:
ensure => directory,
}
}
class directory::subdirectory {
file {
"$directory::path/other":
ensure => directory,
require =>
[File["$directory::path"],Class["directory"]];
}
}
# if I include directory::subdirectory at the end, it works
# but classes come from an ENC, can''t order since it''s a hash
include directory::subdirectory
class { "directory":
path => "/tmp/test",
stage => pre
}
Applying this manifest produces:
warning: Scope(Class[Directory::Subdirectory]): Could not look up
qualified variable ''directory::path''; class directory has not
been
evaluated at test.pp:16
warning: Scope(Class[Directory::Subdirectory]): Could not look up
qualified variable ''directory::path''; class directory has not
been
evaluated at test.pp:14
Could not find dependency File[] for File[/other] at test.pp:17
any hint?
--
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.