Hi all, I'm trying to promote module re-use so that if I have a module that deals with ldap and I have setup variables in a common configuration and I want to access those same defaulted variables from another module I can easily do so.
Below is how I'm *attempting* to do this and in MY opinion I think it should work ;-) Puppet feels differently and in my node where I include the class rep I get an error back from puppet saying that it could not find the value for ldap_cname in my template. I believe this should work because the rep module includes the config which includes the ldap::variables_common which should then define $ldap_cname and the file /etc/rep.xml requires ldap::variables_common before the template. Can anybody kindly show me the error of my ways? Thanks! Chris -- Examples Modules Below -- modules/ldap/manifests/init.pp: class ldap { variables_common } class ldap::variables_common { if( !$ldap_cname) { $ldap_cname="admin" } } In file modules/rep/manifests/init.pp class rep { include config } class rep::config { include ldap::variables_common file { "/etc/rep.xml": ensure => file, require => Class["ldap::variables_common"], content => template("rep/test_template.xml.erb"); } } modules/rep/templates/test_template.xml.erb <?xml version="1.0"?> <configuration> <test_template cname='<%= ldap_cname %> /> </configuration> -- 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.