inventory

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChildrenGroup

type ChildrenGroup struct {
	Hosts map[string]Vars `yaml:"hosts"`
	Vars  Vars            `yaml:"vars"`
}

type DefaultInventoryParser added in v0.1.1

type DefaultInventoryParser struct{}

func (*DefaultInventoryParser) Parse added in v0.1.1

func (parser *DefaultInventoryParser) Parse(data []byte) (*Inventory, error)

type DefaultInventoryReader added in v0.1.1

type DefaultInventoryReader struct{}

func (*DefaultInventoryReader) ReadInventory added in v0.1.1

func (reader *DefaultInventoryReader) ReadInventory(filePath string) (string, error)

type GroupDetail added in v0.1.1

type GroupDetail struct {
	Name  string
	Vars  Vars
	Hosts []HostDetail
}

type HostDetail added in v0.1.1

type HostDetail struct {
	Name string
	Vars Vars
}

type HostInventory

type HostInventory struct {
	Hosts    map[string]Vars          `yaml:"hosts"`
	Children map[string]ChildrenGroup `yaml:"children"`
	Vars     Vars                     `yaml:"vars"`
}

type Inventory

type Inventory struct {
	All HostInventory `yaml:"all"`
}

func DefaultInventory added in v0.1.1

func DefaultInventory() Inventory

type InventoryManager added in v0.1.1

type InventoryManager interface {
	GetUngroupedHosts() []HostDetail
	GetGroups() []GroupDetail
	GetGroupHosts(group string) []HostDetail
	GetHostSSHAgent(groupName, hostName string) (bool, error)
	GetHostSSHAgentForwarding(groupName, hostName string) (bool, error)
	GetHostSSHKey(groupName, hostName string) (string, error)
	GetHostUsername(groupName, hostName string) (string, error)
	GetHostPassword(groupName, hostName string) (string, error)
	GetHostAddress(groupName, hostName string) (string, error)
	GetHostPort(groupName, hostName string) (int, error)
	GetAccessConfig(groupName, hostName string) (*access.AccessConfig, error)
}

type InventoryParser added in v0.1.1

type InventoryParser interface {
	Parse(data []byte) (*Inventory, error)
}

type InventoryReader added in v0.1.1

type InventoryReader interface {
	ReadInventory(filePath string) (string, error)
}

type InventoryService added in v0.1.1

type InventoryService struct {
	Inventory *Inventory
}

func NewInventoryService added in v0.1.1

func NewInventoryService(reader InventoryReader, parser InventoryParser) (*InventoryService, error)

func (*InventoryService) GetAccessConfig added in v0.1.1

func (s *InventoryService) GetAccessConfig(groupName, hostName string) (*access.AccessConfig, error)

func (*InventoryService) GetGroupHosts added in v0.1.1

func (s *InventoryService) GetGroupHosts(group string) []HostDetail

func (*InventoryService) GetGroups added in v0.1.1

func (s *InventoryService) GetGroups() []GroupDetail

func (*InventoryService) GetHostAddress added in v0.1.1

func (s *InventoryService) GetHostAddress(groupName, hostName string) (string, error)

func (*InventoryService) GetHostPassword added in v0.1.1

func (s *InventoryService) GetHostPassword(groupName, hostName string) (string, error)

func (*InventoryService) GetHostPort added in v0.1.1

func (s *InventoryService) GetHostPort(groupName, hostName string) (int, error)

func (*InventoryService) GetHostSSHAgent added in v0.1.1

func (s *InventoryService) GetHostSSHAgent(groupName, hostName string) (bool, error)

func (*InventoryService) GetHostSSHAgentForwarding added in v0.1.1

func (s *InventoryService) GetHostSSHAgentForwarding(groupName, hostName string) (bool, error)

func (*InventoryService) GetHostSSHKey added in v0.1.1

func (s *InventoryService) GetHostSSHKey(groupName, hostName string) (string, error)

func (*InventoryService) GetHostUsername added in v0.1.1

func (s *InventoryService) GetHostUsername(groupName, hostName string) (string, error)

func (*InventoryService) GetUngroupedHosts added in v0.1.1

func (s *InventoryService) GetUngroupedHosts() []HostDetail

type Vars

type Vars struct {
	Username           string `yaml:"username,omitempty"`
	AnsibleUser        string `yaml:"ansible_user,omitempty"`
	Password           string `yaml:"password,omitempty"`
	AnsibleSshPASS     string `yaml:"ansible_ssh_pass,omitempty"`
	SshKey             string `yaml:"sshkey,omitempty"`
	Address            string `yaml:"address,omitempty"`
	AnsibleHost        string `yaml:"ansible_host,omitempty"`
	SshAgent           bool   `yaml:"sshagent,omitempty"`
	SshAgentForwarding bool   `yaml:"sshagent_forwarding,omitempty"`
	Port               int    `yaml:"port,omitempty"`
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL