Documentation ¶
Index ¶
- type Inventory
- func (inv *Inventory) AddGroup(s, p string) error
- func (inv *Inventory) AddGroupMemberCounter(counterType, groupName string) error
- func (inv *Inventory) AddHost(s, groupName string) error
- func (inv *Inventory) AddVariable(s, groupName string) error
- func (inv *Inventory) GetGroup(s string) (*InventoryGroup, error)
- func (inv *Inventory) GetHost(s string) (*InventoryHost, error)
- func (inv *Inventory) GetHosts() ([]*InventoryHost, error)
- func (inv *Inventory) GetHostsWithFilter(hostFilter, groupFilter interface{}) ([]*InventoryHost, error)
- func (inv *Inventory) GetParentGroup(s string) ([]string, error)
- func (inv *Inventory) GetParentGroupChains(s string) ([]string, []string, error)
- func (inv *Inventory) LoadFromBytes(b []byte) error
- func (inv *Inventory) LoadFromFile(fp string) error
- func (inv *Inventory) Size() uint64
- type InventoryGroup
- type InventoryGroupCounters
- type InventoryHost
- type Vault
- type VaultBody
- type VaultCredential
- type VaultHeader
- type VaultKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Inventory ¶
type Inventory struct { Raw []byte HostsRef map[string]string `json:"host_refs,omitempty" yaml:"host_refs,omitempty"` GroupsRef map[string]bool `json:"group_refs,omitempty" yaml:"group_refs,omitempty"` Hosts []*InventoryHost `json:"hosts,omitempty" yaml:"hosts,omitempty"` Groups []*InventoryGroup `json:"groups,omitempty" yaml:"groups,omitempty"` }
Inventory is the contents of Ansible inventory file.
func (*Inventory) AddGroupMemberCounter ¶
AddGroupMemberCounter increments group membership counters for hosts and sub-groups.
func (*Inventory) AddVariable ¶
AddVariable adds a variable to an InventoryGroup.
func (*Inventory) GetGroup ¶
func (inv *Inventory) GetGroup(s string) (*InventoryGroup, error)
GetGroup returns an instance of InventoryGroup.
func (*Inventory) GetHost ¶
func (inv *Inventory) GetHost(s string) (*InventoryHost, error)
GetHost returns an instance of InventoryHost.
func (*Inventory) GetHosts ¶
func (inv *Inventory) GetHosts() ([]*InventoryHost, error)
GetHosts returns a list of InventoryHost instances.
func (*Inventory) GetHostsWithFilter ¶ added in v1.0.5
func (inv *Inventory) GetHostsWithFilter(hostFilter, groupFilter interface{}) ([]*InventoryHost, error)
GetHostsWithFilter returns a list of InventoryHost instances filtered by input host and group patterns. Returns the host matching the patterns only.
func (*Inventory) GetParentGroup ¶
GetParentGroup gets parent inventory groups for the provided one.
func (*Inventory) GetParentGroupChains ¶
GetParentGroupChains gets parent inventory groups recursively for the provided one.
func (*Inventory) LoadFromBytes ¶
LoadFromBytes loads inventory data from an array of bytes.
func (*Inventory) LoadFromFile ¶
LoadFromFile loads inventory data from a file.
type InventoryGroup ¶
type InventoryGroup struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Ancestors []string `json:"parent_groups,omitempty" yaml:"parent_groups,omitempty"` Variables map[string]string `json:"variables,omitempty" yaml:"variables,omitempty"` Counters InventoryGroupCounters `json:"counters,omitempty" yaml:"counters,omitempty"` }
InventoryGroup is an group of InventoryHost instances.
type InventoryGroupCounters ¶ added in v1.0.6
type InventoryGroupCounters struct { Hosts uint64 `json:"hosts,omitempty" yaml:"hosts,omitempty"` Groups uint64 `json:"groups,omitempty" yaml:"groups,omitempty"` }
InventoryGroupCounters are counters associated with InventoryGroup
type InventoryHost ¶
type InventoryHost struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` Parent string `json:"parent_group,omitempty" yaml:"parent_group,omitempty"` Variables map[string]string `json:"variables,omitempty" yaml:"variables,omitempty"` Groups []string `json:"groups,omitempty" yaml:"groups,omitempty"` GroupChains []string `json:"group_chains,omitempty" yaml:"group_chains,omitempty"` }
InventoryHost is a host in Ansible inventory
type Vault ¶
type Vault struct { Header VaultHeader `xml:"-" json:"-" yaml:"-"` Body VaultBody `xml:"-" json:"-" yaml:"-"` Key VaultKey `xml:"-" json:"-" yaml:"-"` Password []byte `xml:"-" json:"-" yaml:"-"` Payload []byte `xml:"-" json:"-" yaml:"-"` Credentials []*VaultCredential `xml:"credentials" json:"credentials" yaml:"credentials"` }
Vault is the contents of Ansible vault file.
func (*Vault) GetCredentials ¶
func (v *Vault) GetCredentials(s string) ([]*VaultCredential, error)
GetCredentials returns a list of credential applicable to the provided host name.
func (*Vault) LoadFromBytes ¶
LoadFromBytes loads vault data from an array of bytes.
func (*Vault) LoadFromFile ¶
LoadFromFile loads vault data from a file.
func (*Vault) LoadPasswordFromFile ¶
LoadPasswordFromFile loads unlock password for the vault from a file.
func (*Vault) SetPassword ¶
SetPassword sets unlock password for the vault.
type VaultBody ¶
type VaultBody struct { Salt []byte `xml:"-" json:"-" yaml:"-"` HMAC []byte `xml:"-" json:"-" yaml:"-"` Data []byte `xml:"-" json:"-" yaml:"-"` }
VaultBody is the body of a Vault.
type VaultCredential ¶
type VaultCredential struct { Description string `xml:"description,omitempty" json:"description,omitempty" yaml:"description,omitempty"` Regex string `xml:"regex,omitempty" json:"regex,omitempty" yaml:"regex,omitempty"` Username string `xml:"username,omitempty" json:"username,omitempty" yaml:"username,omitempty"` Password string `xml:"password,omitempty" json:"password,omitempty" yaml:"password,omitempty"` EnabledPassword string `xml:"password_enable,omitempty" json:"password_enable,omitempty" yaml:"password_enable,omitempty"` Priority int `xml:"priority,omitempty" json:"priority,omitempty" yaml:"priority,omitempty"` Default bool `xml:"default,omitempty" json:"default,omitempty" yaml:"default,omitempty"` }
VaultCredential is a decoded credential from a Vault.
func (*VaultCredential) String ¶
func (c *VaultCredential) String() string
type VaultHeader ¶
type VaultHeader struct { Format string `xml:"-" json:"-" yaml:"-"` Version string `xml:"-" json:"-" yaml:"-"` Cipher string `xml:"-" json:"-" yaml:"-"` }
VaultHeader is the header of a Vault.