Issue #1889 has been updated by luke. Status changed from Needs more information to Rejected
Ah, I see what's happening here. The defined resource is evaluated on the collecting side rather than the exporting side, so that's whose information you get. The way to fix this is to provide the data you need in your template as arguments to the definition. There's essentially no way we could evaluate the collected, defined resource in the context of the exporting host unless we evaluated it there and exported all of the resulting contained resources. We used to do a form of that, but it was incredibly messy. It's much easier to just be explicit in the data your defined resource needs. ---------------------------------------- Bug #1889: Variable aren't Exported with Resources http://projects.reductivelabs.com/issues/1889 Author: dkM1 Status: Rejected Priority: Normal Assigned to: luke Category: Target version: Complexity: Unknown Affected version: 0.24.7 Keywords: I would expect the variable to be the values defined on node that is exporting the resource. <pre> class export::collect_test { Export::Collect_define <<||>> } define export::collect_define () { $target_fqdn = $fqnd file { "$name": ensure => file, owner => "root", group => "root", mode => 755, content => template(remote_export/test.erb); } } class remote_export::remote_test { file { "/tmp/testrequirefile": ensure => file, owner => "root", group => "root", mode => 755, content => "I am only required on remote host"; } @@export::collect_define { $name: } } </pre> test.erb: <pre> remote_fqdn = <%=target_fqdn%> </pre> ---------------------------------------- You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://reductivelabs.com/redmine/my/account --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Bugs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/puppet-bugs?hl=en -~----------~----~----~----~------~----~------~--~---
