Documentation
¶
Index ¶
- type Group
- type Host
- type Inventory
- type InventoryPlugin
- type PluginGroup
- type PluginHost
- type PluginInventoryResult
- type PluginManager
- func (pm *PluginManager) DiscoverPlugins() ([]string, error)
- func (pm *PluginManager) LoadInventoryFromExecutable(ctx context.Context, execPath string, args ...string) (*Inventory, error)
- func (pm *PluginManager) LoadInventoryFromPlugin(ctx context.Context, pluginName string, config map[string]interface{}, ...) (*Inventory, error)
- func (pm *PluginManager) LoadPlugin(ctx context.Context, pluginName string, config map[string]interface{}, ...) (*PluginInventoryResult, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InventoryPlugin ¶
type InventoryPlugin interface {
// Name returns the name of the plugin
Name() string
// Execute runs the plugin with the given configuration and returns inventory data
Execute(ctx context.Context, config map[string]interface{}) (*PluginInventoryResult, error)
}
InventoryPlugin defines the interface that all inventory plugins must implement
type PluginGroup ¶
type PluginGroup struct {
Hosts []string `json:"hosts,omitempty"`
Children []string `json:"children,omitempty"`
Vars map[string]interface{} `json:"vars,omitempty"`
}
PluginGroup represents a group from a plugin
type PluginHost ¶
type PluginHost struct {
Name string `json:"-"`
Vars map[string]interface{} `json:"hostvars,omitempty"`
}
PluginHost represents a host from a plugin
type PluginInventoryResult ¶
type PluginInventoryResult struct {
Hosts map[string]*PluginHost `json:"_meta"`
Groups map[string]*PluginGroup `json:",inline"`
}
PluginInventoryResult represents the result from an inventory plugin
type PluginManager ¶
type PluginManager struct {
// contains filtered or unexported fields
}
PluginManager manages inventory plugin discovery and execution
func NewPluginManager ¶
func NewPluginManager() *PluginManager
NewPluginManager creates a new plugin manager
func (*PluginManager) DiscoverPlugins ¶
func (pm *PluginManager) DiscoverPlugins() ([]string, error)
DiscoverPlugins discovers available inventory plugins
func (*PluginManager) LoadInventoryFromExecutable ¶
func (pm *PluginManager) LoadInventoryFromExecutable(ctx context.Context, execPath string, args ...string) (*Inventory, error)
LoadInventoryFromExecutable executes an external inventory script/binary that outputs Ansible-compatible JSON for `--list` and converts it into the standard Inventory format. It reuses the same JSON parsing logic used for Python plugins.
func (*PluginManager) LoadInventoryFromPlugin ¶
func (pm *PluginManager) LoadInventoryFromPlugin(ctx context.Context, pluginName string, config map[string]interface{}, inventoryContent []byte) (*Inventory, error)
LoadInventoryFromPlugin loads inventory from a plugin and converts to standard Inventory format
func (*PluginManager) LoadPlugin ¶
func (pm *PluginManager) LoadPlugin(ctx context.Context, pluginName string, config map[string]interface{}, inventoryContent []byte) (*PluginInventoryResult, error)
LoadPlugin attempts to load an inventory plugin by name