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) 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(s string) error
- func (inv *Inventory) Size() uint64
- type InventoryGroup
- 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
GroupsRef map[string]bool
Hosts []*InventoryHost
Groups []*InventoryGroup
}
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) 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
Ancestors []string
Variables map[string]string
Counters struct {
Hosts uint64
Groups uint64
}
}
InventoryGroup is an group of InventoryHost instances.
type InventoryHost ¶
type InventoryHost struct {
Name string
Parent string
Variables map[string]string
Groups []string
GroupChains []string
}
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" json:"description" yaml:"description"`
Regex string `xml:"regex" json:"regex" yaml:"regex"`
Username string `xml:"username" json:"username" yaml:"username"`
Password string `xml:"password" json:"password" yaml:"password"`
EnabledPassword string `xml:"password_enable" json:"password_enable" yaml:"password_enable"`
Priority int `xml:"priority" json:"priority" yaml:"priority"`
Default bool `xml:"default" json:"default" yaml:"default"`
}
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.