Hi all,
given these two classes inside the file '/etc/puppet/modules/templates_eval/manifests/init.pp':
53 class templates_eval::providevars {
54
55 $hibernate_connection_dialect="org.hibernate.dialect.Oracle10gDialect"
56 }
57
58 class templates_eval::testvars {
59
60 include templates_eval::providevars
61
62 file {
63 "/tmp/tmplteval.properties":
64 ensure => "present",
65 mode => 644,
66 content => template("templates_eval/global.properties.erb"),
67 }
68 }
The file '/etc/puppet/manifests/site.pp' includes class 'templates_eval::testvars':
13 node "
myhostname.net" {
...
17 include templates_eval::testvars
18 }
This is the content of template '/etc/puppet/modules/templates_eval/templates/global.properties.erb':
12
13 domain.suffix=<%= fqdn %>
14
15 hibernate.connection.dialect=<%= hibernate_connection_dialect %>
However, when running Puppet on a Puppet node, obviously the variable '$hibernate_connection_dialect' cannot be resolved:
[root@myhostname puppet]# puppetd -v -d --test
...
err: Could not retrieve catalog from remote server: Error 400 on SERVER: Failed to parse template templates_eval/global.properties.erb: Could not find value for 'hibernate_connection_dialect' at /etc/puppet/modules/templates_eval/manifests/init.pp:64 on node
myhostname.net
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
[root@myhostname puppet]#
Obviously the 'include templates_eval::providevars' inside class 'templates_eval::testvars' has no impact. I tried several other approaches (importing manifests, etc.), too. But none of them worked. So the basic question is: How can I have a set of variables defined in scope X (where X might be a manifest, a class, or a define) and include it into scope Y (where Y will most likely be a class or maybe a node).
Thanks in advance for any help!
Bernd
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to
puppet...@googlegroups.com.
To unsubscribe from this group, send email to
puppet-users...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en.