GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Rex::CMDB(3) User Contributed Perl Documentation Rex::CMDB(3)

Rex::CMDB - Function to access the CMDB (configuration management database)

This module exports a function to access a CMDB via a common interface. When the 0.51 feature flag or later is used, the CMDB is enabled by default with Rex::CMDB::YAML as the default provider.

 use Rex::CMDB;
 
 set cmdb => {
   type           => 'YAML',
   path           => [ 'cmdb/{hostname}.yml', 'cmdb/default.yml', ],
   merge_behavior => 'LEFT_PRECEDENT',
 };
 
 task 'prepare', 'server1', sub {
   my %all_information          = get cmdb;
   my $specific_item            = get cmdb('item');
   my $specific_item_for_server = get cmdb( 'item', 'server' );
 };

 set cmdb => {
   type => 'YAML',
   %provider_options,
 };

Instantiate a specific "type" of CMDB provider with the given options. Returns the provider instance.

Please consult the documentation of the given provider for their supported options.

Function to query a CMDB.

If called without arguments, it returns the full CMDB data structure for the current connection.

If only a defined $item is passed, it returns only the value for the given CMDB item, for the current connection.

If only a defined $server is passed, it returns the whole CMDB data structure for the given server.

If both $item and $server are defined, it returns the given CMDB item for the given server.

The value returned is a Rex::Value, so you may need to use the "get cmdb(...)" form if you'd like to assign the result to a Perl variable:

 task 'prepare', 'server1', sub {
   my %all_information          = get cmdb;
   my $specific_item            = get cmdb('item');
   my $specific_item_for_server = get cmdb( 'item', 'server' );
 };

If caching is enabled, this function caches the full data structure for the given server under the "cmdb/$CMDB_PROVIDER/$server" cache key after the first query.

2021-07-05 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.