Documentation
¶
Index ¶
- Constants
- func IsTmplSyntax(s string) bool
- func ParseTmplSyntax(s string) string
- func TrimTmplSyntax(s string) string
- type Base
- type Block
- type BlockBase
- type BlockInfo
- type CollectionSearch
- type Conditional
- type Delegable
- type Handler
- type LoopControl
- type Notifiable
- type Play
- type PlayHost
- type PlaySerial
- type Playbook
- type Role
- type RoleInfo
- type Taggable
- type Task
- type Vars
- type When
Constants ¶
const ( // AlwaysTag it always run AlwaysTag = "always" // NeverTag it never run NeverTag = "never" // AllTag represent all tags AllTag = "all" // TaggedTag represent which has tags TaggedTag = "tagged" )
the special tags
Variables ¶
This section is empty.
Functions ¶
func IsTmplSyntax ¶
IsTmplSyntax Check if the string conforms to the template syntax.
func ParseTmplSyntax ¶
ParseTmplSyntax wraps a string with template syntax delimiters "{{" and "}}" to make it a valid Go template expression
func TrimTmplSyntax ¶
Types ¶
type Base ¶
type Base struct {
Name string `yaml:"name,omitempty"`
// connection/transport
Connection string `yaml:"connection,omitempty"`
Port int `yaml:"port,omitempty"`
RemoteUser string `yaml:"remote_user,omitempty"`
// variables
Vars Vars `yaml:"vars,omitempty"`
// flags and misc. settings
Environment []map[string]string `yaml:"environment,omitempty"`
NoLog bool `yaml:"no_log,omitempty"`
RunOnce bool `yaml:"run_once,omitempty"`
IgnoreErrors *bool `yaml:"ignore_errors,omitempty"`
CheckMode bool `yaml:"check_mode,omitempty"`
Diff bool `yaml:"diff,omitempty"`
AnyErrorsFatal bool `yaml:"any_errors_fatal,omitempty"`
Throttle int `yaml:"throttle,omitempty"`
Timeout int `yaml:"timeout,omitempty"`
// Debugger invoke a debugger on tasks
Debugger string `yaml:"debugger,omitempty"`
// privilege escalation
Become bool `yaml:"become,omitempty"`
BecomeMethod string `yaml:"become_method,omitempty"`
BecomeUser string `yaml:"become_user,omitempty"`
BecomeFlags string `yaml:"become_flags,omitempty"`
BecomeExe string `yaml:"become_exe,omitempty"`
}
Base defined in project.
type Block ¶
type Block struct {
BlockBase
// If it has Block, Task should be empty
Task
IncludeTasks string `yaml:"include_tasks,omitempty"`
BlockInfo
}
Block defined in project.
type BlockBase ¶
type BlockBase struct {
Base `yaml:",inline"`
Conditional `yaml:",inline"`
CollectionSearch `yaml:",inline"`
Taggable `yaml:",inline"`
Notifiable `yaml:",inline"`
Delegable `yaml:",inline"`
}
BlockBase defined in project.
type BlockInfo ¶
type BlockInfo struct {
Block []Block `yaml:"block,omitempty"`
Rescue []Block `yaml:"rescue,omitempty"`
Always []Block `yaml:"always,omitempty"`
}
BlockInfo defined in project.
type CollectionSearch ¶
type CollectionSearch struct {
Collections []string `yaml:"collections,omitempty"`
}
CollectionSearch defined in project.
type Conditional ¶
type Conditional struct {
When When `yaml:"when,omitempty"`
}
Conditional defined in project.
type Delegable ¶
type Delegable struct {
DelegateTo string `yaml:"delegate_to,omitempty"`
DelegateFacts bool `yaml:"delegate_facts,omitempty"`
}
Delegable defined in project.
type Handler ¶
type Handler struct {
Listen []string `yaml:"listen,omitempty"`
}
Handler defined in project.
type LoopControl ¶
type LoopControl struct {
LoopVar string `yaml:"loop_var,omitempty"`
IndexVar string `yaml:"index_var,omitempty"`
Label string `yaml:"label,omitempty"`
Pause float32 `yaml:"pause,omitempty"`
Extended bool `yaml:"extended,omitempty"`
ExtendedAllitems bool `yaml:"extended_allitems,omitempty"`
}
LoopControl defined in project.
type Notifiable ¶
type Notifiable struct {
Notify string `yaml:"notify,omitempty"`
}
Notifiable defined in project.
type Play ¶
type Play struct {
ImportPlaybook string `yaml:"import_playbook,omitempty"`
Base `yaml:",inline"`
Taggable `yaml:",inline"`
CollectionSearch `yaml:",inline"`
PlayHost PlayHost `yaml:"hosts,omitempty"`
// Facts
GatherFacts bool `yaml:"gather_facts,omitempty"`
// Variable Attribute
VarsFiles []string `yaml:"vars_files,omitempty"`
// Role Attributes
Roles []Role `yaml:"roles,omitempty"`
// Block (Task) Lists Attributes
Handlers []Block `yaml:"handlers,omitempty"`
PreTasks []Block `yaml:"pre_tasks,omitempty"`
PostTasks []Block `yaml:"post_tasks,omitempty"`
Tasks []Block `yaml:"tasks,omitempty"`
// Flag/Setting Attributes
ForceHandlers bool `yaml:"force_handlers,omitempty"`
MaxFailPercentage float32 `yaml:"percent,omitempty"`
Serial PlaySerial `yaml:"serial,omitempty"`
Strategy string `yaml:"strategy,omitempty"`
Order string `yaml:"order,omitempty"`
}
Play defined in project.
type PlaySerial ¶
type PlaySerial struct {
Data []any
}
PlaySerial defined in project.
func (*PlaySerial) UnmarshalYAML ¶
func (s *PlaySerial) UnmarshalYAML(node *yaml.Node) error
UnmarshalYAML yaml string to serial.
type RoleInfo ¶
type RoleInfo struct {
Base `yaml:",inline"`
Conditional `yaml:",inline"`
Taggable `yaml:",inline"`
CollectionSearch `yaml:",inline"`
RoleDependency []Role `yaml:"dependencies,omitempty"`
// Role ref in playbook
Role string `yaml:"role,omitempty"`
Block []Block
}
RoleInfo defined in project.
type Taggable ¶
type Taggable struct {
Tags []string `yaml:"tags,omitempty"`
}
Taggable if it should executor
type Task ¶
type Task struct {
AsyncVal int `yaml:"async,omitempty"`
ChangedWhen When `yaml:"changed_when,omitempty"`
Delay int `yaml:"delay,omitempty"`
FailedWhen When `yaml:"failed_when,omitempty"`
Loop any `yaml:"loop,omitempty"`
LoopControl LoopControl `yaml:"loop_control,omitempty"`
Poll int `yaml:"poll,omitempty"`
Register string `yaml:"register,omitempty"`
// RegisterType how to register value to variable. support: string(default), json, yaml.
RegisterType string `yaml:"register_type,omitempty"`
Retries int `yaml:"retries,omitempty"`
Until When `yaml:"until,omitempty"`
// UnknownField store undefined field
UnknownField map[string]any `yaml:"-"`
}
Task defined in project.