Documentation
¶
Index ¶
- Constants
- Variables
- func ClientKeyAuth(keyFile string) (ssh.AuthMethod, error)
- func Debug(fields map[string]interface{}, msg string)
- func ErrKeyword(val interface{}) error
- func ErrNotValidVariable(val interface{}) error
- func ErrWrongType(field interface{}, val interface{}, _type string) error
- func Error(fields map[string]interface{}, msg string)
- func Fatal(fields map[string]interface{}, msg string)
- func GetInventoryGroups(planBuf []byte) ([]string, error)
- func HenchErr(err error, fields map[string]interface{}, extMsg string) error
- func Info(fields map[string]interface{}, msg string)
- func InitConfiguration(filename string) error
- func InitLog()
- func MergeLogrusFields(src map[string]interface{}, dst map[string]interface{}, override bool)
- func MergeMap(src map[interface{}]interface{}, dst map[interface{}]interface{}, ...)
- func PasswordAuth(pass string) (ssh.AuthMethod, error)
- func Printf(msg string, a ...interface{})
- func PrintfAndFill(size int, fill string, msg string, a ...interface{})
- func Println(msg string)
- func SprintfAndFill(size int, fill string, msg string, a ...interface{}) string
- func Warn(fields map[string]interface{}, msg string)
- type Configuration
- type CustomUnmarshalError
- type HenchmanError
- type HostGroup
- type Inventory
- type InventoryConfig
- type InventoryInterface
- type LocalTransport
- type Machine
- type Module
- type Plan
- type PlanProxy
- type RegMap
- type SSHTransport
- type Task
- type TaskProxy
- type TaskResult
- type TransportConfig
- type TransportInterface
- type VarsMap
- type VarsProxy
- type YAMLInventory
Constants ¶
const ( HENCHMAN_PREFIX = "henchman_" TARGET = "modules.tar" )
const ( ECHO = 53 TTY_OP_ISPEED = 128 TTY_OP_OSPEED = 129 )
Variables ¶
var (
DebugFlag bool
)
var ModuleSearchPath = []string{
"modules",
}
Functions ¶
func ClientKeyAuth ¶
func ClientKeyAuth(keyFile string) (ssh.AuthMethod, error)
func ErrKeyword ¶
func ErrKeyword(val interface{}) error
func ErrNotValidVariable ¶
func ErrNotValidVariable(val interface{}) error
func ErrWrongType ¶
func InitConfiguration ¶
func MergeLogrusFields ¶
func MergeMap ¶
func MergeMap(src map[interface{}]interface{}, dst map[interface{}]interface{}, override bool)
*
- These functions deal with merging of maps
source values will override dest values if override is true else dest values will not be overridden
func PasswordAuth ¶
func PasswordAuth(pass string) (ssh.AuthMethod, error)
func PrintfAndFill ¶
Does a printf and fills the extra white space Just specify the max size to fill to and the string to fill with
func SprintfAndFill ¶
Does a Sprintf and fills the extra white space
Types ¶
type Configuration ¶
var Config Configuration
Global config object for henchman to use
type CustomUnmarshalError ¶
type CustomUnmarshalError struct {
Err error
}
func (*CustomUnmarshalError) Error ¶
func (cue *CustomUnmarshalError) Error() string
type HenchmanError ¶
type HenchmanError struct { Err error Fields map[string]interface{} // contains filtered or unexported fields }
func (*HenchmanError) Error ¶
func (henchError *HenchmanError) Error() string
type HostGroup ¶
type HostGroup struct { Hosts []string `yaml:"hosts"` Vars map[interface{}]interface{} `yaml:"vars"` }
type Inventory ¶
type Inventory struct { //GroupHosts map[string][]*Machine Groups map[string]HostGroup `yaml:"groups"` HostVars map[string]map[interface{}]interface{} `yaml:"host_vars"` GlobalVars map[interface{}]interface{} `yaml:"global_vars"` }
type Inventory map[string][]*Machine
func (*Inventory) GetInventoryForGroups ¶
*
- Returns a filtered inventory depending on which groups are specified
- Keeps the groups specified in the filtered inventory
func (*Inventory) GetMachines ¶
func (inv *Inventory) GetMachines(tc TransportConfig) ([]*Machine, error)
type InventoryConfig ¶
type InventoryInterface ¶
type InventoryInterface interface {
Load(ic InventoryConfig) (Inventory, error)
}
type LocalTransport ¶
type LocalTransport struct{}
Transport for the current machine on which henchman is being run on
func NewLocal ¶
func NewLocal(config *TransportConfig) (*LocalTransport, error)
func (*LocalTransport) Initialize ¶
func (local *LocalTransport) Initialize(config *TransportConfig) error
type Machine ¶
type Machine struct { Hostname string Vars VarsMap Transport TransportInterface }
type PlanProxy ¶
type PlanProxy struct { Name string `yaml:"name"` Sudo bool `yaml:"sudo"` Debug bool `yaml:"debug"` TaskProxies []*TaskProxy `yaml:"tasks"` VarsProxy *VarsProxy `yaml:"vars"` InventoryGroups []string `yaml:"hosts"` }
func (PlanProxy) PreprocessTasks ¶
Checks the a slice of TaskProxy ptrs passed in by a Plan and determines whether if it's an include value or a normal task. If it's a normal task it appends it as a standard task, otherwise it recursively expands the include statement NOTE: making this a function of PlanProxy in case we want to have more plan level variables
in the future. Removes the need to pass each variable as a parameter.
func (PlanProxy) PreprocessVars ¶
Processes plan level vars with includes All plan level vars will be in the vars map And any repeat vars in the includes will be a FCFS priority NOTE: if the user has multiple include blocks it'll grab the one closest to
the bottom
type SSHTransport ¶
type SSHTransport struct { Host string Port uint16 Config *ssh.ClientConfig }
func NewSSH ¶
func NewSSH(config *TransportConfig) (*SSHTransport, error)
func (*SSHTransport) Initialize ¶
func (sshTransport *SSHTransport) Initialize(config *TransportConfig) error
type Task ¶
type Task struct { Id string Debug bool IgnoreErrors bool `yaml:"ignore_errors"` Local bool Module Module Name string Register string Retry int Sudo bool Vars VarsMap When string }
func (*Task) ProcessWhen ¶
checks and converts when to bool
type TaskProxy ¶
type TaskProxy struct { Task `yaml:",inline"` SudoState string DebugState string Include string IncludeVars VarsMap `yaml:"vars"` }
Task is for the general Task format. Refer to task.go Vars are kept in scope for each Task. So there is a Vars field for each task Include is the file name for the included Tasks list
func (*TaskProxy) UnmarshalYAML ¶
Custom unmarshaller which accounts for module names
type TaskResult ¶
type TransportConfig ¶
type TransportInterface ¶
type VarsMap ¶
type VarsMap map[interface{}]interface{}
type VarsProxy ¶
type VarsProxy struct {
Vars VarsMap
}
func (*VarsProxy) UnmarshalYAML ¶
Custom unmarshaller which account for multiple include statements and include types NOTE: Cannot account for double includes because unmarshal(&vMap) already does
under the hood unmarshaling and does what any map would do, which is override repeating key values
type YAMLInventory ¶
type YAMLInventory struct { Groups map[string]HostGroup `yaml:"groups"` HostVars map[string]map[interface{}]interface{} `yaml:"host_vars"` GlobalVars map[interface{}]interface{} `yaml:"global_vars"` }
FIXME: Have a way to provide specifics
func (*YAMLInventory) Load ¶
func (yi *YAMLInventory) Load(ic InventoryConfig) (Inventory, error)
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Godeps
|
|
_workspace/src/code.google.com/p/go-uuid/uuid
The uuid package generates and inspects UUIDs.
|
The uuid package generates and inspects UUIDs. |
_workspace/src/code.google.com/p/go.crypto/ssh
Package ssh implements an SSH client and server.
|
Package ssh implements an SSH client and server. |
_workspace/src/code.google.com/p/go.crypto/ssh/agent
Package agent implements a client to an ssh-agent daemon.
|
Package agent implements a client to an ssh-agent daemon. |
_workspace/src/code.google.com/p/go.crypto/ssh/terminal
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
|
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems. |
_workspace/src/code.google.com/p/go.crypto/ssh/test
This package contains integration tests for the code.google.com/p/go.crypto/ssh package.
|
This package contains integration tests for the code.google.com/p/go.crypto/ssh package. |
_workspace/src/github.com/flosch/pongo2
A Django-syntax like template-engine Blog posts about pongo2 (including introduction and migration): https://www.florian-schlachter.de/?tag=pongo2 Complete documentation on the template language: https://docs.djangoproject.com/en/dev/topics/templates/ Try out pongo2 live in the pongo2 playground: https://www.florian-schlachter.de/pongo2/ Make sure to read README.md in the repository as well.
|
A Django-syntax like template-engine Blog posts about pongo2 (including introduction and migration): https://www.florian-schlachter.de/?tag=pongo2 Complete documentation on the template language: https://docs.djangoproject.com/en/dev/topics/templates/ Try out pongo2 live in the pongo2 playground: https://www.florian-schlachter.de/pongo2/ Make sure to read README.md in the repository as well. |
_workspace/src/github.com/stretchr/testify/assert
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system.
|
Package assert provides a set of comprehensive testing tools for use with the normal Go testing system. |
_workspace/src/github.com/stretchr/testify/require
Alternative testing tools which stop test execution if test failed.
|
Alternative testing tools which stop test execution if test failed. |
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
|
Package yaml implements YAML support for the Go language. |