Documentation ¶
Index ¶
- func FileExists(f string) bool
- func MapKeys[T string, V any](data map[string]V) []string
- func Uniq(slice []string) []string
- func Unquote(s string) string
- type AnsibleCfg
- type Host
- type HostVars
- func (hv HostVars) Admin() string
- func (hv HostVars) Admins() []string
- func (hv HostVars) Bool(key string) *bool
- func (hv HostVars) Domain() (base, domain string)
- func (hv HostVars) Email() string
- func (hv HostVars) Emails() []string
- func (hv HostVars) FQN(key string) string
- func (hv HostVars) HasTODOs() bool
- func (hv HostVars) IsAdmin(input string) bool
- func (hv HostVars) MaintenanceBranch() string
- func (hv HostVars) MaintenanceEnabled() bool
- func (hv HostVars) OSGroup() string
- func (hv HostVars) OSPath() string
- func (hv HostVars) OSUser() string
- func (hv HostVars) String(key string, optionalDefault ...string) string
- func (hv HostVars) StringSlice(key string) []string
- func (hv HostVars) Yes(missing bool, key string) bool
- type Inventory
- type LineType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AnsibleCfg ¶
func NewAnsibleCfgFile ¶
func NewAnsibleCfgFile(f string) (*AnsibleCfg, error)
func NewAnsibleCfgParser ¶
func NewAnsibleCfgParser(input []byte) *AnsibleCfg
type Host ¶
type Host struct { Vars HostVars // host vars Dirs []string Files map[string]string Group string // main group Groups []string // all related groups Name string // host name Host string // host address Port int // host port User string // host user SSHPass string // host ssh password BecomePass string // host become password PrivateKey string // host ssh private key OrderedAt string }
Host is a parsed host
type HostVars ¶
func NewHostVarsFile ¶
func NewHostVarsParser ¶
func (HostVars) FQN ¶
FQN attempts to parse FQN var and replaces {{ matrix_domain }}, {{ base_domain }}, etc.
func (HostVars) MaintenanceBranch ¶
MaintenanceBranch returns docker tag
func (HostVars) MaintenanceEnabled ¶
MaintenanceEnabled returns bool
func (HostVars) StringSlice ¶
StringSlice returns string slice value
type Inventory ¶
type Inventory struct { Groups map[string][]*Host // host-by-group GroupVars map[string]map[string]string // group vars GroupTree map[string][]string // raw group tree Hosts map[string]*Host // hosts-by-name // contains filtered or unexported fields }
Inventory contains all hosts file content
func ParseInventory ¶
ParseInventory using ansible.cfg and hosts (ini) files
type LineType ¶
type LineType int
const ( TypeIgnore LineType = iota // Line to ignore TypeVar LineType = iota // Line contains var (key=value pair) TypeHost LineType = iota // Line contains host (name key1=value1 key2=value2 ...) TypeGroup LineType = iota // Line contains group ([group]) TypeGroupVars LineType = iota // Line contains group vars ([group:vars]) TypeGroupChild LineType = iota // Line contains group child (group_child) TypeGroupChildren LineType = iota // Line contains group children ([group_children]) )
Click to show internal directories.
Click to hide internal directories.