Puppet: System Administration Automated

Support

Ticket #1165 (closed enhancement: worksforme)

Opened 5 months ago

Last modified 5 months ago

Support for class inclussion test

Reported by: jgonzalez Assigned to: luke
Priority: normal Milestone:
Component: library Version: 0.24.4
Severity: normal Keywords:
Cc: Triage Stage: Needs design decision
Attached Patches: None Complexity: Hard

Description

It would be great if we could have a included function that would test for class inclussion.

My use case: I currently have some definitions that doesn't make sense unless a given node includes a class related to those definitions (for example, think of class postgres::server and definition postgres::database}. I would like the parser to fail and log some custom error (using fail) if someone uses the definition without including the class, and the only way I can think of doing it is testing for definition of some resource only managed by that class, but that seems to be a bit shabby. A included function would cleanly solve this problem.

Change History

04/03/08 12:22:31 changed by jamtur01

  • owner changed from community to luke.
  • complexity changed from Unknown to Hard.
  • stage changed from Unreviewed to Needs design decision.

Okay - I can see the requirement - not sure how it'd be achieved. Luke - over to you if you want to add it and have time/inclination.

04/03/08 17:36:36 changed by luke

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

Just use this:

if defined(Class[my::class]) { ... }

Works for me: http://www.madstop.com/puppet/checking_whether_classes_have_been_evaluated.html