Documentation ¶
Index ¶
- Constants
- Variables
- func ChangePerm(owner string, suid, sgid int) (uid, gid int, err error)
- func DisplayScope(s Scope)
- func ExpandTemplates(s Scope, args string) (string, error)
- func ExpandTemplatesIn(s Scope, in []byte) ([]byte, error)
- func ExpandVars(s Scope, args string) (string, error)
- func ExpandVarsOnly(s Scope, args string) (string, error)
- func HomeDir() (string, error)
- func ImportVarsFile(s Scope, path string) error
- func Main(args []string) int
- func MakeCommand(s Scope, task *Task, args string) (Command, Vars, error)
- func RegisterCommand(name string, cmd Command)
- func SV(v interface{}, ok bool) interface{}
- func StartPlaybook(env *Environment, file string) error
- type AnyMap
- type AnyValue
- type ArgParser
- type CLIReporter
- func (c *CLIReporter) EndReporter(r *Runner, err error)
- func (c *CLIReporter) FinishAll(r *Runner)
- func (c *CLIReporter) FinishHandlers(r *Runner)
- func (c *CLIReporter) FinishTask(task *Task, res *Result)
- func (c *CLIReporter) FinishTasks(r *Runner)
- func (c *CLIReporter) StartHandlers(r *Runner)
- func (c *CLIReporter) StartTask(task *Task, name, args string, vars Vars)
- func (c *CLIReporter) StartTasks(r *Runner)
- type Command
- type CommandCmd
- type CommandEnv
- type CommandResult
- type Commands
- type Config
- type CopyCmd
- type DownloadCmd
- type Environment
- type Future
- type FutureScope
- type Futures
- type JsonChunkReporter
- func (c *JsonChunkReporter) EndReporter(r *Runner, err error)
- func (c *JsonChunkReporter) FinishAll(r *Runner)
- func (c *JsonChunkReporter) FinishHandlers(r *Runner)
- func (c *JsonChunkReporter) FinishTask(task *Task, res *Result)
- func (c *JsonChunkReporter) FinishTasks(r *Runner)
- func (c *JsonChunkReporter) StartHandlers(r *Runner)
- func (c *JsonChunkReporter) StartTask(task *Task, name, args string, vars Vars)
- func (c *JsonChunkReporter) StartTasks(r *Runner)
- type Map
- type MkFileCmd
- type Module
- type ModuleRun
- type NestedScope
- type Notifications
- type Options
- type Paths
- type Play
- type Playbook
- type PriorityScope
- type Reporter
- type Result
- func FailureResult(err error) *Result
- func NewResult(changed bool) *Result
- func RunAdhocCommand(cmd Command, debug, output bool, args string) (*Result, error)
- func RunAdhocTask(cmd, args string) (*Result, error)
- func RunAdhocTaskVars(td TaskData) (*Result, error)
- func WrapResult(changed bool, data ResultData) *Result
- type ResultData
- type RunResult
- type Runner
- type SSH
- func (s *SSH) Cleanup()
- func (s *SSH) Command(args ...string) *exec.Cmd
- func (s *SSH) CommandWithOptions(cmd string, args ...string) []string
- func (s *SSH) CopyToHost(src, dest string) error
- func (s *SSH) ImportVagrant(target string) bool
- func (s *SSH) RsyncCommand() string
- func (s *SSH) Run(args ...string) error
- func (s *SSH) RunAndCapture(args ...string) ([]byte, error)
- func (s *SSH) RunAndShow(args ...string) error
- func (s *SSH) SSHCommand(cmd string, args ...string) []string
- func (s *SSH) Start() error
- type Scope
- type ScopeGetter
- type ScriptCmd
- type SeparatePaths
- func (s SeparatePaths) Base() string
- func (s SeparatePaths) File(name string) string
- func (s SeparatePaths) Handler(name string) string
- func (s SeparatePaths) Meta(name string) string
- func (s SeparatePaths) Role(name string) string
- func (s SeparatePaths) Task(name string) string
- func (s SeparatePaths) TemplateFile(name string) string
- func (s SeparatePaths) Vars(name string) string
- type ShellCmd
- type SimplePath
- func (s SimplePath) Base() string
- func (s SimplePath) File(name string) string
- func (s SimplePath) Handler(name string) string
- func (s SimplePath) Meta(name string) string
- func (s SimplePath) Role(name string) string
- func (s SimplePath) Task(name string) string
- func (s SimplePath) TemplateFile(name string) string
- func (s SimplePath) Vars(name string) string
- type StrMap
- type StructReporter
- func (c *StructReporter) EndReporter(r *Runner, err error)
- func (c *StructReporter) FinishAll(r *Runner)
- func (c *StructReporter) FinishHandlers(r *Runner)
- func (c *StructReporter) FinishTask(task *Task, res *Result)
- func (c *StructReporter) FinishTasks(r *Runner)
- func (c *StructReporter) StartHandlers(r *Runner)
- func (c *StructReporter) StartTask(task *Task, name, args string, vars Vars)
- func (c *StructReporter) StartTasks(r *Runner)
- type Svinfo
- type Task
- func (t *Task) Args() string
- func (t *Task) Async() bool
- func (t *Task) Command() string
- func (t *Task) Future() string
- func (t *Task) Init(env *Environment) error
- func (t *Task) Items() []interface{}
- func (t *Task) Name() string
- func (t *Task) Notify() []string
- func (t *Task) Register() string
- func (t *Task) When() string
- type TaskData
- type TaskResult
- type Tasks
- type TemplateCmd
- type Value
- type Vars
- type VarsFiles
Constants ¶
View Source
const MaxTaskResult = 500
Variables ¶
View Source
var Arg0 string
View Source
var DefaultConfig = &Config{false, false, ""}
View Source
var Release string = "dev"
View Source
var Version string
Functions ¶
func DisplayScope ¶
func DisplayScope(s Scope)
func ImportVarsFile ¶
func RegisterCommand ¶
func StartPlaybook ¶
func StartPlaybook(env *Environment, file string) error
Types ¶
type AnyMap ¶
type AnyMap struct {
// contains filtered or unexported fields
}
func (AnyMap) MarshalJSON ¶
type AnyValue ¶
type AnyValue struct {
// contains filtered or unexported fields
}
func (AnyValue) MarshalJSON ¶
type CLIReporter ¶
type CLIReporter struct { Output bool Debug bool Start time.Time // contains filtered or unexported fields }
func (*CLIReporter) EndReporter ¶
func (c *CLIReporter) EndReporter(r *Runner, err error)
func (*CLIReporter) FinishAll ¶
func (c *CLIReporter) FinishAll(r *Runner)
func (*CLIReporter) FinishHandlers ¶
func (c *CLIReporter) FinishHandlers(r *Runner)
func (*CLIReporter) FinishTask ¶
func (c *CLIReporter) FinishTask(task *Task, res *Result)
func (*CLIReporter) FinishTasks ¶
func (c *CLIReporter) FinishTasks(r *Runner)
func (*CLIReporter) StartHandlers ¶
func (c *CLIReporter) StartHandlers(r *Runner)
func (*CLIReporter) StartTask ¶
func (c *CLIReporter) StartTask(task *Task, name, args string, vars Vars)
func (*CLIReporter) StartTasks ¶
func (c *CLIReporter) StartTasks(r *Runner)
type Command ¶
type Command interface {
Run(env *CommandEnv) (*Result, error)
}
type CommandCmd ¶
type CommandCmd struct { Command string `goansible:"command,required"` Creates string `goansible:"creates"` IgnoreFail bool `goansible:"ignore_failure"` IgnoreChanged bool `goansible:"ignore_changed"` ManualStatus bool `goansible:"manual_status"` OkRc int `goansible:"ok_rc"` ChangedRc int `goansible:"changed_rc"` ChangedCreate string `goansible:"changed_create"` }
func (*CommandCmd) Run ¶
func (cmd *CommandCmd) Run(env *CommandEnv) (*Result, error)
type CommandEnv ¶
type CommandEnv struct { Env *Environment Paths Paths }
func NewCommandEnv ¶
func NewCommandEnv(env *Environment, task *Task) *CommandEnv
type CommandResult ¶
func RunCommand ¶
func RunCommand(env *CommandEnv, parts ...string) (*CommandResult, error)
func RunCommandInEnv ¶
func RunCommandInEnv(env *CommandEnv, unixEnv []string, parts ...string) (*CommandResult, error)
type CopyCmd ¶
type DownloadCmd ¶
type DownloadCmd struct { Url string `goansible:"url,required"` Dest string `goansible:"dest"` Sha256sum string `goansible:"sha256sum"` Once bool `goansible:"once"` }
func (*DownloadCmd) Run ¶
func (d *DownloadCmd) Run(env *CommandEnv) (*Result, error)
type Environment ¶
func NewEnv ¶
func NewEnv(s Scope, cfg *Config) *Environment
func (*Environment) Cleanup ¶
func (e *Environment) Cleanup()
func (*Environment) ReportJSON ¶
func (e *Environment) ReportJSON()
func (*Environment) ReportStruct ¶
func (e *Environment) ReportStruct() error
func (*Environment) SetPaths ¶
func (e *Environment) SetPaths(n Paths) Paths
type Future ¶
type FutureScope ¶
type FutureScope struct { Scope // contains filtered or unexported fields }
func NewFutureScope ¶
func NewFutureScope(parent Scope) *FutureScope
func (*FutureScope) AddFuture ¶
func (fs *FutureScope) AddFuture(key string, f *Future)
func (*FutureScope) Results ¶
func (fs *FutureScope) Results() []RunResult
func (*FutureScope) Wait ¶
func (fs *FutureScope) Wait()
type JsonChunkReporter ¶
func (*JsonChunkReporter) EndReporter ¶
func (c *JsonChunkReporter) EndReporter(r *Runner, err error)
func (*JsonChunkReporter) FinishAll ¶
func (c *JsonChunkReporter) FinishAll(r *Runner)
func (*JsonChunkReporter) FinishHandlers ¶
func (c *JsonChunkReporter) FinishHandlers(r *Runner)
func (*JsonChunkReporter) FinishTask ¶
func (c *JsonChunkReporter) FinishTask(task *Task, res *Result)
func (*JsonChunkReporter) FinishTasks ¶
func (c *JsonChunkReporter) FinishTasks(r *Runner)
func (*JsonChunkReporter) StartHandlers ¶
func (c *JsonChunkReporter) StartHandlers(r *Runner)
func (*JsonChunkReporter) StartTask ¶
func (c *JsonChunkReporter) StartTask(task *Task, name, args string, vars Vars)
func (*JsonChunkReporter) StartTasks ¶
func (c *JsonChunkReporter) StartTasks(r *Runner)
type MkFileCmd ¶
type ModuleRun ¶
type NestedScope ¶
func NewNestedScope ¶
func NewNestedScope(parent Scope) *NestedScope
func SpliceOverrides ¶
func SpliceOverrides(cur Scope, override *NestedScope) *NestedScope
func (*NestedScope) Empty ¶
func (n *NestedScope) Empty() bool
func (*NestedScope) Flatten ¶
func (n *NestedScope) Flatten() Scope
func (*NestedScope) Set ¶
func (n *NestedScope) Set(key string, v interface{})
type Notifications ¶
type Notifications []string
type Options ¶
type Options struct { Vars map[string]string `short:"s" long:"set" description:"Set a variable"` ShowOutput bool `short:"o" long:"output" description:"Show command output"` ShowVersion bool `short:"v" long:"version" description:"Show version"` Passphrase string `short:"p" long:"Passphrase" description:"passphrase of decode"` Development bool `long:"dev" description:"Use a dev version of goansible"` Debug bool `short:"d" long:"debug" description:"Show all information about commands"` JSON bool `long:"json" description:"Output the run details in chunked json"` }
type Playbook ¶
type Playbook struct { Path string Plays []*Play Env *Environment Vars *NestedScope // contains filtered or unexported fields }
func NewPlaybook ¶
func NewPlaybook(env *Environment, p string) (*Playbook, error)
func NewPlaybookBytes ¶
func NewPlaybookBytes(env *Environment, playBytes []byte) (*Playbook, error)
func (*Playbook) LoadPlayDatas ¶
type PriorityScope ¶
type PriorityScope struct {
// contains filtered or unexported fields
}
func (*PriorityScope) Set ¶
func (p *PriorityScope) Set(key string, val interface{})
type Result ¶
type Result struct { Changed bool Failed bool Data ResultData }
func FailureResult ¶
func RunAdhocCommand ¶
func RunAdhocTask ¶
func RunAdhocTaskVars ¶
func WrapResult ¶
func WrapResult(changed bool, data ResultData) *Result
func (*Result) MarshalJSON ¶
type ResultData ¶
func (ResultData) Get ¶
func (rd ResultData) Get(key string) interface{}
func (ResultData) Set ¶
func (rd ResultData) Set(key string, v interface{})
type Runner ¶
type Runner struct { Results []RunResult Start time.Time Runtime time.Duration // contains filtered or unexported fields }
func NewRunner ¶
func NewRunner(env *Environment, plays []*Play) *Runner
func (*Runner) Run ¶
func (r *Runner) Run(env *Environment) error
func (*Runner) ShouldRunHandler ¶
type SSH ¶
func (*SSH) CommandWithOptions ¶
func (*SSH) CopyToHost ¶
func (*SSH) ImportVagrant ¶
func (*SSH) RsyncCommand ¶
func (*SSH) RunAndShow ¶
type ScopeGetter ¶
type ScriptCmd ¶
type ScriptCmd struct { Script string `goansible:"command,required"` Creates string `goansible:"creates"` IgnoreFail bool `goansible:"ignore_failure"` IgnoreChanged bool `goansible:"ignore_changed"` ManualStatus bool `goansible:"manual_status"` OkRc int `goansible:"ok_rc"` ChangedRc int `goansible:"changed_rc"` ChangedCreate string `goansible:"changed_create"` }
type SeparatePaths ¶
func (SeparatePaths) Base ¶
func (s SeparatePaths) Base() string
func (SeparatePaths) File ¶
func (s SeparatePaths) File(name string) string
func (SeparatePaths) Handler ¶
func (s SeparatePaths) Handler(name string) string
func (SeparatePaths) Meta ¶
func (s SeparatePaths) Meta(name string) string
func (SeparatePaths) Role ¶
func (s SeparatePaths) Role(name string) string
func (SeparatePaths) Task ¶
func (s SeparatePaths) Task(name string) string
func (SeparatePaths) TemplateFile ¶
func (s SeparatePaths) TemplateFile(name string) string
func (SeparatePaths) Vars ¶
func (s SeparatePaths) Vars(name string) string
type ShellCmd ¶
type ShellCmd struct { Command string `goansible:"command,required"` Creates string `goansible:"creates"` IgnoreFail bool `goansible:"ignore_failure"` IgnoreChanged bool `goansible:"ignore_changed"` ManualStatus bool `goansible:"manual_status"` OkRc int `goansible:"ok_rc"` ChangedRc int `goansible:"changed_rc"` ChangedCreate string `goansible:"changed_create"` }
type SimplePath ¶
type SimplePath struct {
Root string
}
func (SimplePath) Base ¶
func (s SimplePath) Base() string
func (SimplePath) File ¶
func (s SimplePath) File(name string) string
func (SimplePath) Handler ¶
func (s SimplePath) Handler(name string) string
func (SimplePath) Meta ¶
func (s SimplePath) Meta(name string) string
func (SimplePath) Role ¶
func (s SimplePath) Role(name string) string
func (SimplePath) Task ¶
func (s SimplePath) Task(name string) string
func (SimplePath) TemplateFile ¶
func (s SimplePath) TemplateFile(name string) string
func (SimplePath) Vars ¶
func (s SimplePath) Vars(name string) string
type StrMap ¶
type StrMap struct {
// contains filtered or unexported fields
}
func (StrMap) MarshalJSON ¶
type StructReporter ¶
type StructReporter struct { Hostname string ServerType string Project string Start time.Time TasksFinishDur time.Duration FinishDur time.Duration TaskCount int Out []TaskResult }
func (*StructReporter) EndReporter ¶
func (c *StructReporter) EndReporter(r *Runner, err error)
func (*StructReporter) FinishAll ¶
func (c *StructReporter) FinishAll(r *Runner)
func (*StructReporter) FinishHandlers ¶
func (c *StructReporter) FinishHandlers(r *Runner)
func (*StructReporter) FinishTask ¶
func (c *StructReporter) FinishTask(task *Task, res *Result)
func (*StructReporter) FinishTasks ¶
func (c *StructReporter) FinishTasks(r *Runner)
func (*StructReporter) StartHandlers ¶
func (c *StructReporter) StartHandlers(r *Runner)
func (*StructReporter) StartTask ¶
func (c *StructReporter) StartTask(task *Task, name, args string, vars Vars)
func (*StructReporter) StartTasks ¶
func (c *StructReporter) StartTasks(r *Runner)
type Task ¶
type Task struct { Play *Play Vars Vars IncludeVars Vars Paths Paths // contains filtered or unexported fields }
func (*Task) Init ¶
func (t *Task) Init(env *Environment) error
type TaskResult ¶
type TemplateCmd ¶
type TemplateCmd struct { Src string `goansible:"src,required"` Dest string `goansible:"dest,required"` Owner string `goansible:"owner"` Uid int `goansible:"uid"` Gid int `goansible:"gid"` Mode int `goansible:"mode"` }
func (*TemplateCmd) Run ¶
func (cmd *TemplateCmd) Run(env *CommandEnv) (*Result, error)
type Vars ¶
func VarsFromStrMap ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.