Modify

Ticket #696 (closed enhancement: wontfix)

Opened 10 years ago

Last modified 10 years ago

Chained probes (calling probes from within other probes)

Reported by: hcoyote@… Owned by: desai
Priority: major Milestone: Bcfg2 1.0.0 Release
Component: bcfg2-client Version:
Keywords: Cc:

Description

I'd like to be able to call a probe from another probe. The driving factor for this is to reduce code duplication in my probes. An example:

I have a probe that uses dmidecode to determine what hardware manufacturer I'm currently running on. This sets a dynamic group that I use within my configuration (manuf-dell, for example).

I have a second probe that queries my RPM database looking for a specific rpm gpg key and sets a dynamic group if I don't find it (rpm_needs_dell_gpg). The problem is, I only want to set this group if I know I'm running on dell hardware.

I have three options for doing this:

  1. One monolithic probe that combines these two options so I reduce code duplication. This is unappealing because this can get large quick (for one script).
  1. Have my rpm_gpg probe issue the same dmidecode command as my manufacturer probe. This is unappealing because that means I have to update two places if I ever need to change the dmidecode call.
  1. Move the manufacturer specific rpm gpg probes into the manufacturer probe. This is unappealing because that means I have to update two places if I ever need to change the rpm calls or methods I use to probe for gpg keys.

Attachments

Change History

comment:1 Changed 10 years ago by solj

  • Milestone set to Bcfg2 1.0 Release

comment:2 Changed 10 years ago by desai

  • Status changed from new to closed
  • Resolution set to wontfix

I think that this could be better factored as a series of boolean flags (determined by probes) with a server side template that combines the conditions to achieve the desired result. This would result in probes that set groups like is_dell_hardware, and has_dell_gpgkey, which could be combined in an SGenshi template to have the desired result.

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.