Documentation ¶
Index ¶
- Constants
- func PatchAnsibleGroup(g *Group, ah *ActionHosts)
- type ActionHosts
- type Group
- func (g *Group) AddChildGroup(group *Group)
- func (g *Group) AddChildren(inventory *Inventory)
- func (g *Group) AddDefaultVars()
- func (g *Group) AddHost(host string)
- func (g *Group) AddHosts(hosts ...string)
- func (g *Group) AddVar(key string, value interface{})
- func (g *Group) AddVars(vars map[string]interface{})
- func (g *Group) HasHost(host string) bool
- func (g *Group) HostsList() []string
- func (g *Group) Name() string
- func (g *Group) RemoveHost(host string)
- func (g *Group) RemoveHosts(hosts ...string)
- func (g *Group) RemoveVar(key string)
- func (g *Group) SetChildren(inventory *Inventory)
- func (g *Group) SetDefaultSSHMode(mode string)
- func (g *Group) SetDefaultSSHPassword(password string)
- func (g *Group) SetDefaultSSHPort(port int)
- func (g *Group) SetDefaultSSHUser(user string)
- func (m *Group) SetHostVar(host, varName string, varValue interface{})
- func (m *Group) SetHostVars(host string, vars map[string]interface{})
- type GroupsMap
- type Inventory
- func (i *Inventory) AddAllGroup()
- func (i *Inventory) AddGroup(group *Group) error
- func (i *Inventory) FillAll()
- func (i *Inventory) FilterOutIP(ipnet *net.IPNet)
- func (i *Inventory) GetAllHosts() []string
- func (i *Inventory) GetGroup(groupName string) (*Group, error)
- func (i *Inventory) HasAllGroup() bool
- func (i *Inventory) HasGroup(groupName string) bool
- func (i *Inventory) HasMetaGroup() bool
- func (i *Inventory) MarshalJSON() ([]byte, error)
- func (i *Inventory) Merge(new *Inventory) error
- func (i *Inventory) MergeWithFuncs(inventoryFinderFuncs ...InventoryFinderFunc) error
- func (i *Inventory) RemoveGroup(groupName string)
- func (i *Inventory) SetDefaultSSHPassword(password string)
- func (i *Inventory) SetDefaultSSHPort(port int)
- func (i *Inventory) SetDefaultSSHUser(user string)
- func (i *Inventory) SetGroup(group *Group)
- func (i *Inventory) UnmarshalJSON(data []byte) error
- func (i *Inventory) UnmarshalYAML(value *yaml.Node) error
- type InventoryFinderFunc
- type Module
- type ModuleArgs
- type Play
- type Playbook
- type Role
- type Task
Constants ¶
const ( MetaGroupName string = "_meta" AllGroupName string = "all" UngroupedGroupName string = "ungrouped" )
Variables ¶
This section is empty.
Functions ¶
func PatchAnsibleGroup ¶
func PatchAnsibleGroup(g *Group, ah *ActionHosts)
Types ¶
type ActionHosts ¶
ActionHosts wrapps the Action and Hosts list. Action can be "add", "remove", "update". Hosts is a list of host addresses.
type Group ¶
type Group struct { // Hosts store hostvars for each host Hosts *map[string]map[string]interface{} `json:"hosts,omitempty" yaml:"hosts,omitempty"` // Vars store groupvars for this group Vars *map[string]interface{} `json:"vars,omitempty" yaml:"vars,omitempty"` Children *Inventory `json:"children,omitempty" yaml:"children,omitempty"` // contains filtered or unexported fields }
func (*Group) AddChildGroup ¶
func (*Group) AddChildren ¶
AddChildren set the groups in inventory to Children of group.
func (*Group) AddDefaultVars ¶
func (g *Group) AddDefaultVars()
func (*Group) RemoveHost ¶
func (*Group) RemoveHosts ¶
func (*Group) SetChildren ¶
SetChildren set inventory as the Children of group by overriding the Children field
func (*Group) SetDefaultSSHMode ¶
func (*Group) SetDefaultSSHPassword ¶
func (*Group) SetDefaultSSHPort ¶
func (*Group) SetDefaultSSHUser ¶
func (*Group) SetHostVar ¶
func (*Group) SetHostVars ¶
type Inventory ¶
type Inventory struct { GroupsMap `json:",inline" yaml:",inline"` // contains filtered or unexported fields }
func NewAnsibleInventory ¶
func NewAnsibleInventory() *Inventory
NewAnsibleInventory create a top level inventory. You should call NewInventory to create other level inventory.
func NewInventory ¶
func NewInventory() *Inventory
func (*Inventory) AddAllGroup ¶
func (i *Inventory) AddAllGroup()
AddAllGroup adds a "all" group to the inventory. Only the top level inventory should call this method.
func (*Inventory) FillAll ¶
func (i *Inventory) FillAll()
FillAll adds default vars to the 'all' group of the inventory. Only the top level inventory should have 'all' group, so should call this method.
func (*Inventory) FilterOutIP ¶
func (*Inventory) GetAllHosts ¶
func (*Inventory) HasAllGroup ¶
func (*Inventory) HasMetaGroup ¶
func (*Inventory) MarshalJSON ¶
MarshalJSON provides custom method when json.Marshal(i). 'inline' is not an official option of JSON struct tags.
func (*Inventory) MergeWithFuncs ¶
func (i *Inventory) MergeWithFuncs(inventoryFinderFuncs ...InventoryFinderFunc) error
func (*Inventory) RemoveGroup ¶
SetGroup set group to inventory, override if group already exist
func (*Inventory) SetDefaultSSHPassword ¶
func (*Inventory) SetDefaultSSHPort ¶
func (*Inventory) SetDefaultSSHUser ¶
func (*Inventory) UnmarshalJSON ¶
func (*Inventory) UnmarshalYAML ¶
type InventoryFinderFunc ¶
type Module ¶ added in v0.1.7
type Module map[string]ModuleArgs
type ModuleArgs ¶ added in v0.1.7
type ModuleArgs map[string]interface{}
type Play ¶
type Play struct { Name string `yaml:"name"` Hosts yaml.Node `yaml:"hosts"` AnyErrorsFatal bool `yaml:"any_errors_fatal"` GatherFacts bool `yaml:"gather_facts"` Become bool `yaml:"become"` Tasks []Task `yaml:"tasks,omitempty"` Roles []Role `yaml:"roles,omitempty"` Tags []string `yaml:"tags,omitempty"` }