Puppet: System Administration Automated

Support

Ticket #779 (closed enhancement: wontfix)

Opened 1 year ago

Last modified 1 year ago

access to inherited variables from within a template

Reported by: simu Assigned to: luke
Priority: normal Milestone:
Component: language Version: 0.23.1
Severity: normal Keywords: templating, inheritance
Cc: Triage Stage: Unreviewed
Attached Patches: None Complexity: Unknown

Description

The syntax $someclas::somevar (rather "<%= someclass:somevar %>") is not avalible in templates, this makes templating quite unusable if you have one host configure an other ones configfiles.

Would be realy nice to have and the besic functinallity is there, just erb cant seem to handle the "::" notation.

Change History

08/22/07 10:59:17 changed by mpalmer

This is where "Puppet isn't Ruby" bites hard. I have no idea what a fully-qualified Puppet variable might look like in ERb, but I suspect it wouldn't be pretty.

I think you've got a bigger problem than ERb syntax, though -- the idea of "one host [configuring] another one's config files" just scares the willies out of me, and I suggest you rethink your manifest design somewhat.

08/22/07 21:34:48 changed by lutter

As a workaround, have you tried doing this in your template:

  var: <%= scope.lookupvar("someclass::somevar") %>

That worked for me for a very simple example.

09/06/07 19:29:35 changed by michael

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

Use the workaround mentioned by lutter.