Ticket #696 (closed enhancement: wontfix)
Chained probes (calling probes from within other probes)
Reported by: | [email protected]… | 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:
- 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).
- 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.
- 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:2 Changed 14 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.