Puppet: System Administration Automated

Support

Ticket #771 (closed defect: wontfix)

Opened 1 year ago

Last modified 1 year ago

Variables set top-level in modules aren't set elsewhere

Reported by: danp Assigned to: luke
Priority: normal Milestone:
Component: language Version: 0.23.1
Severity: normal Keywords: module variable scope
Cc: Triage Stage: Unreviewed
Attached Patches: None Complexity: Unknown

Description

In the init.pp of my daemontools module, here, I set two variables outside the daemontools class, expecting to use them in other modules or my main manifests. The variables don't seem to be available elsewhere. If I require File[daemontools-service-dir] in another module, $service_dir evaluates to an empty string. If I use $service_dir in a string it's interpolated to an empty string.

When I first ran into the problem, I fixed it by copying the two definitions to the top of my main site.pp. Puppet didn't notice that I was setting the same variables twice. In a current svn version, though, it seems to notice. It's just not making them available elsewhere.

Change History

08/15/07 09:33:07 changed by DavidS

This looks like another case of the problems discussed in #723

09/06/07 19:46:45 changed by michael

  • status changed from new to closed.
  • resolution set to wontfix.

You should just use the fully qualified variable reference form for this:

class whatever {
  $mything = $daemontools::mything
}

I expect that David's right that the problems you're experiencing are order-related, which makes this a bug that's not likely to get fixed.