Puppet: System Administration Automated

Support

Ticket #1222 (reopened enhancement)

Opened 8 months ago

Last modified 8 months ago

Evaluate variables in tempates (similar to if defined in a manifest)

Reported by: ohadlevy Assigned to: community
Priority: normal Milestone:
Component: newfeature Version:
Severity: normal Keywords:
Cc: Triage Stage: Accepted
Attached Patches: None Complexity: Unknown

Description

I'm looking for a way to evaluate a variable inside a template. so far the only way I could think of implementing it would be:

in the manifest:

klass="abc"

in the template:

<%
begin
   classname = klass
rescue
   classname = "Unknown"
end
-%>
<% if classname = "abc" %>
something
<% end %>

it should be possible to use in a template:

<& if defined(klass) &>
something
<% end %>

Change History

05/15/08 05:59:38 changed by ohadlevy

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

ok, duplicate of #1177

05/15/08 06:11:05 changed by ohadlevy

ok, this enhancement require a feature which is not included in #1177. if you would like to check if a class is being included, the has_variable patch should check also for class names (which would mean to check also if the variable is a class name).

can anyone reopen this ticket?

05/15/08 06:27:57 changed by luke

  • status changed from closed to reopened.
  • resolution deleted.

05/16/08 09:43:37 changed by jamtur01

  • stage changed from Unreviewed to Accepted.